Bypass the default query of the User class when no uid is specified
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 13 Jul 2010 12:12:38 +0000 (14:12 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Tue, 13 Jul 2010 12:13:18 +0000 (14:13 +0200)
(avoiding malformed queries).

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/user.php

index b2a75f0..f7f90fa 100644 (file)
@@ -148,6 +148,10 @@ class User extends PlUser
 
     protected static function loadMainFieldsFromUIDs(array $uids, $respect_order = true)
     {
+        if (empty($uids)) {
+            return PlIteratorUtils::emptyIterator();
+        }
+
         global $globals;
         $joins = '';
         $fields = array();