From c44ba8749dfd1408ecefc9c06c9ec78cd063b334 Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Sat, 25 May 2013 21:27:56 -0400 Subject: [PATCH] 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 --- includes/specials/SpecialUndelete.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() ) { -- 2.20.1