(bug 13517) list=users threw fatal error when only invalid usernames are specified
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 26 Mar 2008 18:08:58 +0000 (18:08 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 26 Mar 2008 18:08:58 +0000 (18:08 +0000)
includes/api/ApiQueryUsers.php

index a24e189..80da512 100644 (file)
@@ -63,11 +63,13 @@ if (!defined('MEDIAWIKI')) {
                // Canonicalize user names
                foreach($users as $u) {
                        $n = User::getCanonicalName($u);
-                       if($n === false) 
+                       if($n === false || $n === ''
                                $retval[] = array('name' => $u, 'invalid' => '');
                         else
                                $goodNames[] = $n;
                }
+               if(empty($goodNames))
+                       return $retval;
 
                $db = $this->getDb();
                $userTable = $db->tableName('user');