From 947fec89063fbd87987d87ad99a5d0ce4bdc2457 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Wed, 1 Aug 2007 20:11:29 +0000 Subject: [PATCH] Per Brion's suggestion, fixed blocker user detection: User::whoIs($wgUser->blockedBy()); --- includes/OutputPage.php | 7 +------ includes/api/ApiQueryUserInfo.php | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) 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(); } } -- 2.20.1