From: Roan Kattouw Date: Wed, 26 Mar 2008 18:08:58 +0000 (+0000) Subject: (bug 13517) list=users threw fatal error when only invalid usernames are specified X-Git-Tag: 1.31.0-rc.0~48793 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=91ea00eedcdce0d812f60de8b51ecbb9169801f3;p=lhc%2Fweb%2Fwiklou.git (bug 13517) list=users threw fatal error when only invalid usernames are specified --- diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index a24e189ed9..80da512765 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -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');