From 595de3bc5db89064c459c1b83a4d8867f9bc8e46 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 29 Jan 2015 14:21:31 +0000 Subject: [PATCH] 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 --- authparams.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/authparams.php b/authparams.php index e633dd5..df1fe39 100644 --- a/authparams.php +++ b/authparams.php @@ -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"]); } }