Browse code

make sure POST data is sent urlencoded, our python-based password checker does not support form-data

Hanno Böck authored on20/01/2021 12:54:54
Showing1 changed files
... ...
@@ -33,7 +33,7 @@ function strong_password($password, $user = array())
33 33
         curl_setopt($req, CURLOPT_FOLLOWLOCATION, 0);
34 34
         curl_setopt($req, CURLOPT_POST, 1);
35 35
         curl_setopt($req, CURLOPT_SAFE_UPLOAD, 1);
36
-        curl_setopt($req, CURLOPT_POSTFIELDS, array("password" => $password));
36
+        curl_setopt($req, CURLOPT_POSTFIELDS, "password=".urlencode($password));
37 37
         $result = chop(curl_exec($req));
38 38
         DEBUG($result);
39 39
     }