authparams : remove the spaces before or after the email provided by the user

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1966 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-01-29 14:21:31 +00:00
parent 271356d506
commit 595de3bc5d

View File

@@ -44,7 +44,8 @@ class authparams
{
if (!isset ($_POST["email"]) || !isset ($_POST["password"]))
throw new Exception ("No POST provided", 401);
return array ("email"=>$_POST["email"], "password"=>$_POST["password"]);
return array ("email"=>trim ($_POST["email"]),
"password"=>$_POST["password"]);
}
/** Get informations from previous recorded session */
@@ -73,7 +74,7 @@ class authparams
}
else
{
return array ("email"=>$_SERVER["PHP_AUTH_USER"],
return array ("email"=>trim ($_SERVER["PHP_AUTH_USER"]),
"password"=>$_SERVER["PHP_AUTH_PW"]);
}
}