From: Andrew Garrett Date: Mon, 10 Sep 2007 03:01:09 +0000 (+0000) Subject: * Partial revert of r25680 (The bit that allowed people to provide a null $user and... X-Git-Tag: 1.31.0-rc.0~51454 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=c110702875027137dea75aafec06841353098218;p=lhc%2Fweb%2Fwiklou.git * Partial revert of r25680 (The bit that allowed people to provide a null $user and substitute it for $wgUser -- which didn't work anyway) * Minor bug, pointed out by Simetrical, in currently unused edge cases where $user passed to getUserPermissionsErrors is not $wgUser, and $user is blocked. --- diff --git a/includes/Title.php b/includes/Title.php index 7b8f1737f3..63ec737cf9 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1030,16 +1030,12 @@ class Title { * @param bool $doExpensiveQueries Set this to false to avoid doing unnecessary queries. * @return array Array of arrays of the arguments to wfMsg to explain permissions problems. */ - public function getUserPermissionsErrors( $action, $user = null, $doExpensiveQueries = true ) { + public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true ) { $errors = $this->getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries ); global $wgContLang; global $wgLang; - # Be kinder to people who forget to supply a user, assuming they mean $wgUser - if (!$user) - $user = $wgUser; - if ( wfReadOnly() && $action != 'read' ) { global $wgReadOnly; $errors[] = array( 'readonlytext', $wgReadOnly ); @@ -1071,7 +1067,7 @@ class Title { $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]"; $blockid = $block->mId; $blockExpiry = $user->mBlock->mExpiry; - $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $wgUser->mBlock->mTimestamp ), true ); + $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $user->mBlock->mTimestamp ), true ); if ( $blockExpiry == 'infinity' ) { // Entry in database (table ipblocks) is 'infinity' but 'ipboptions' uses 'infinite' or 'indefinite'