r90093 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90092‎ | r90093 | r90094 >
Date:21:47, 14 June 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
Followup to r86347, r86797: change SpecialUndelete->mFile to mFilename to remove conflict with SpecialPage->mFile which carries different data and is now private.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -570,7 +570,7 @@
571571 * @ingroup SpecialPage
572572 */
573573 class SpecialUndelete extends SpecialPage {
574 - var $mAction, $mTarget, $mTimestamp, $mRestore, $mInvert, $mFile;
 574+ var $mAction, $mTarget, $mTimestamp, $mRestore, $mInvert, $mFilename;
575575 var $mTargetTimestamp, $mAllowed, $mCanView, $mComment, $mToken, $mRequest;
576576
577577 /**
@@ -596,7 +596,7 @@
597597 $this->mSearchPrefix = $this->mRequest->getText( 'prefix' );
598598 $time = $this->mRequest->getVal( 'timestamp' );
599599 $this->mTimestamp = $time ? wfTimestamp( TS_MW, $time ) : '';
600 - $this->mFile = $this->mRequest->getVal( 'file' );
 600+ $this->mFilename = $this->mRequest->getVal( 'file' );
601601
602602 $posted = $this->mRequest->wasPosted() &&
603603 $wgUser->matchEditToken( $this->mRequest->getVal( 'wpEditToken' ) );
@@ -685,11 +685,11 @@
686686 if( $this->mTimestamp !== '' ) {
687687 return $this->showRevision( $this->mTimestamp );
688688 }
689 - if( $this->mFile !== null ) {
690 - $file = new ArchivedFile( $this->mTargetObj, '', $this->mFile );
 689+ if( $this->mFilename !== null ) {
 690+ $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename );
691691 // Check if user is allowed to see this file
692692 if ( !$file->exists() ) {
693 - $wgOut->addWikiMsg( 'filedelete-nofile', $this->mFile );
 693+ $wgOut->addWikiMsg( 'filedelete-nofile', $this->mFilename );
694694 return;
695695 } else if( !$file->userCan( File::DELETED_FILE ) ) {
696696 if( $file->isDeleted( File::DELETED_RESTRICTED ) ) {
@@ -698,11 +698,11 @@
699699 $wgOut->permissionRequired( 'deletedtext' );
700700 }
701701 return false;
702 - } elseif ( !$wgUser->matchEditToken( $this->mToken, $this->mFile ) ) {
703 - $this->showFileConfirmationForm( $this->mFile );
 702+ } elseif ( !$wgUser->matchEditToken( $this->mToken, $this->mFilename ) ) {
 703+ $this->showFileConfirmationForm( $this->mFilename );
704704 return false;
705705 } else {
706 - return $this->showFile( $this->mFile );
 706+ return $this->showFile( $this->mFilename );
707707 }
708708 }
709709 if( $this->mRestore && $this->mAction == 'submit' ) {
@@ -1024,7 +1024,7 @@
10251025 */
10261026 private function showFileConfirmationForm( $key ) {
10271027 global $wgOut, $wgUser, $wgLang;
1028 - $file = new ArchivedFile( $this->mTargetObj, '', $this->mFile );
 1028+ $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename );
10291029 $wgOut->addWikiMsg( 'undelete-show-file-confirm',
10301030 $this->mTargetObj->getText(),
10311031 $wgLang->date( $file->getTimestamp() ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r92434MFT to REL1_18...hashar15:05, 18 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86347Cleanup in SpecialPage.php:...happy-melon21:25, 18 April 2011
r86797Follow-up r86347: the $mFile written to in SpecialUndelete is not actually th...happy-melon21:26, 23 April 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   21:48, 14 June 2011

Fix for 1.18 CR; needs merge to 1.18 release branch.

Status & tagging log