Adds a safeguard in User::getLogin to prevent a null/empty login from returning a...
authorVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 11 Apr 2009 01:17:34 +0000 (03:17 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 11 Apr 2009 01:17:34 +0000 (03:17 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
classes/user.php

index 8b9e141..f633e4e 100644 (file)
@@ -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);