From c110702875027137dea75aafec06841353098218 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 10 Sep 2007 03:01:09 +0000 Subject: [PATCH] * 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. --- includes/Title.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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' -- 2.20.1