From 77b5a3573fcea541bfcb0b16ddc08f3138f7535e Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 25 Jun 2014 19:19:33 -0300 Subject: [PATCH] Make Special:FilePath redirect to Special:Redirect/file Used to redirect to Special:Redirect/file/, which caused an error. Bug: 66980 Change-Id: I8eb484fc88fad323122ddb6c25c55ab404030c64 --- includes/specials/SpecialFilepath.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/specials/SpecialFilepath.php b/includes/specials/SpecialFilepath.php index eb1c139c61..5860f636d7 100644 --- a/includes/specials/SpecialFilepath.php +++ b/includes/specials/SpecialFilepath.php @@ -37,7 +37,12 @@ class SpecialFilepath extends RedirectSpecialPage { function getRedirect( $par ) { $file = $par ?: $this->getRequest()->getText( 'file' ); - return SpecialPage::getSafeTitleFor( 'Redirect', 'file/' . $file ); + if ( $file ) { + $argument = "file/$file"; + } else { + $argument = 'file'; + } + return SpecialPage::getSafeTitleFor( 'Redirect', $argument ); } protected function getGroupName() { -- 2.20.1