From: Yuri Astrakhan Date: Wed, 1 Aug 2007 20:11:29 +0000 (+0000) Subject: Per Brion's suggestion, fixed blocker user detection: User::whoIs($wgUser->blockedBy()); X-Git-Tag: 1.31.0-rc.0~51895 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=947fec89063fbd87987d87ad99a5d0ce4bdc2457;p=lhc%2Fweb%2Fwiklou.git Per Brion's suggestion, fixed blocker user detection: User::whoIs($wgUser->blockedBy()); --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 6442fd58ec..02cbd417a4 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -743,16 +743,11 @@ class OutputPage { $this->setRobotpolicy( 'noindex,nofollow' ); $this->setArticleRelated( false ); - $id = $wgUser->blockedBy(); + $name = User::whoIs( $wgUser->blockedBy() ); $reason = $wgUser->blockedFor(); $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $wgUser->mBlock->mTimestamp ), true ); $ip = wfGetIP(); - if ( is_numeric( $id ) ) { - $name = User::whoIs( $id ); - } else { - $name = $id; - } $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]"; $blockid = $wgUser->mBlock->mId; diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index 6968b0b814..a5b723fea2 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -55,8 +55,7 @@ class ApiQueryUserInfo extends ApiQueryBase { $prop = array_flip($params['prop']); if (isset($prop['blockinfo'])) { if ($wgUser->isBlocked()) { - $id = $wgUser->blockedBy(); - $vals['blockedby'] = is_numeric($id) ? User::whoIs($id) : $id; + $vals['blockedby'] = User::whoIs($wgUser->blockedBy()); $vals['blockreason'] = $wgUser->blockedFor(); } }