From e514a287e9e7096d7e34d546f597b7d536495d20 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 10 Nov 2010 08:22:00 +0000 Subject: [PATCH] * (bug 17996) HTTP redirects are now combined when requesting a special page --- RELEASE-NOTES | 1 + includes/Wiki.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7650126fd0..7dc2623173 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -415,6 +415,7 @@ LocalSettings.php. The specific bugs are listed below in the general notes. $wgExternalLinkTarget * (bug 17789) Added a note to the total views on Special:Statistics saying that is doesn't count non-existing pages and special pages +* (bug 17996) HTTP redirects are now combined when requesting a special page === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/includes/Wiki.php b/includes/Wiki.php index ff80a9721d..7ae585b11c 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -214,6 +214,12 @@ class MediaWiki { && ( !$request->getVal( 'title' ) || $title->getPrefixedDBKey() != $request->getText( 'title' ) ) && !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) ) ) { + if ( $title->getNamespace() == NS_SPECIAL ) { + list( $name, $subpage ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() ); + if ( $name ) { + $title = SpecialPage::getTitleFor( $name, $subpage ); + } + } $targetUrl = $title->getFullURL(); // Redirect to canonical url, make it a 301 to allow caching if( $targetUrl == $request->getFullRequestURL() ) { -- 2.20.1