From: Kevin Israel Date: Sun, 26 May 2013 01:27:56 +0000 (-0400) Subject: Ensure title in NS_FILE before showing archived file X-Git-Tag: 1.31.0-rc.0~19579 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=c44ba8749dfd1408ecefc9c06c9ec78cd063b334;p=lhc%2Fweb%2Fwiklou.git Ensure title in NS_FILE before showing archived file Avoid an MWException "X is not a valid file title." with invalid input such as index.php?title=Special:Undelete&title=X&file=Y . Change-Id: Ie915726fdde8e772a63713d3eb9da232d9fd83bd --- diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 9050724955..c49c3ebb0f 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -760,7 +760,7 @@ class SpecialUndelete extends SpecialPage { if ( $this->mTimestamp !== '' ) { $this->showRevision( $this->mTimestamp ); - } elseif ( $this->mFilename !== null ) { + } elseif ( $this->mFilename !== null && $this->mTargetObj->inNamespace( NS_FILE ) ) { $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename ); // Check if user is allowed to see this file if ( !$file->exists() ) {