r25712 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25711‎ | r25712 | r25713 >
Date:03:01, 10 September 2007
Author:werdna
Status:old
Tags:
Comment:
* 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.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1030,16 +1030,12 @@
10311031 * @param bool $doExpensiveQueries Set this to false to avoid doing unnecessary queries.
10321032 * @return array Array of arrays of the arguments to wfMsg to explain permissions problems.
10331033 */
1034 - public function getUserPermissionsErrors( $action, $user = null, $doExpensiveQueries = true ) {
 1034+ public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true ) {
10351035 $errors = $this->getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries );
10361036
10371037 global $wgContLang;
10381038 global $wgLang;
10391039
1040 - # Be kinder to people who forget to supply a user, assuming they mean $wgUser
1041 - if (!$user)
1042 - $user = $wgUser;
1043 -
10441040 if ( wfReadOnly() && $action != 'read' ) {
10451041 global $wgReadOnly;
10461042 $errors[] = array( 'readonlytext', $wgReadOnly );
@@ -1071,7 +1067,7 @@
10721068 $link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]";
10731069 $blockid = $block->mId;
10741070 $blockExpiry = $user->mBlock->mExpiry;
1075 - $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $wgUser->mBlock->mTimestamp ), true );
 1071+ $blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $user->mBlock->mTimestamp ), true );
10761072
10771073 if ( $blockExpiry == 'infinity' ) {
10781074 // Entry in database (table ipblocks) is 'infinity' but 'ipboptions' uses 'infinite' or 'indefinite'

Follow-up revisions

RevisionCommit summaryAuthorDate
r25754Merged revisions 25607-25751 via svnmerge from...david23:02, 10 September 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r25680* Allow userCan to take null $user - and replace it with $wgUser if passed....werdna08:11, 9 September 2007

Status & tagging log