From: Vincent Zanotti Date: Sat, 11 Apr 2009 01:17:34 +0000 (+0200) Subject: Adds a safeguard in User::getLogin to prevent a null/empty login from returning a... X-Git-Tag: xorg/0.10.1~113 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=f6c58d14e3e156bce6e166b8e4f9fbd9cd78f9d4;p=platal.git Adds a safeguard in User::getLogin to prevent a null/empty login from returning a valid but random profile. Signed-off-by: Vincent Zanotti --- diff --git a/classes/user.php b/classes/user.php index 8b9e141..f633e4e 100644 --- a/classes/user.php +++ b/classes/user.php @@ -26,6 +26,10 @@ class User extends PlUser { global $globals; + if (!$login) { + throw new UserNotFoundException(); + } + // If $data is an integer, fetches directly the result. if (is_numeric($login)) { $res = XDB::query("SELECT user_id FROM auth_user_md5 WHERE user_id = {?}", $login);