X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialFilepath.php;h=618fd1da488637a4f2be6df2ce21b3d8b0bdbee0;hb=8ffabe23a195e47af2a117a2a917a280b3459255;hp=c18faa12d37d7d8004334fd6932da14aec877751;hpb=16c80e429be5904fb42a93f260f8de3d18f0c692;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialFilepath.php b/includes/specials/SpecialFilepath.php index c18faa12d3..618fd1da48 100644 --- a/includes/specials/SpecialFilepath.php +++ b/includes/specials/SpecialFilepath.php @@ -41,12 +41,17 @@ class SpecialFilepath extends RedirectSpecialPage { public function getRedirect( $par ) { $file = $par ?: $this->getRequest()->getText( 'file' ); + $redirect = null; if ( $file ) { - $argument = "file/$file"; - } else { - $argument = 'file'; + $redirect = SpecialPage::getSafeTitleFor( 'Redirect', "file/$file" ); } - return SpecialPage::getSafeTitleFor( 'Redirect', $argument ); + if ( $redirect === null ) { + // The user input is empty or an invalid title, + // redirect to form of Special:Redirect with the invalid value prefilled + $this->mAddedRedirectParams['wpvalue'] = $file; + $redirect = SpecialPage::getSafeTitleFor( 'Redirect', 'file' ); + } + return $redirect; } protected function getGroupName() {