From 39e23c60ecac24fead52b141d84a9410cf7bf946 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 23 Dec 2008 21:57:31 +0000 Subject: [PATCH] Pull back r44972 for now "(Bug 16677) Media: view URLs should HTTP-redirect to canonical File: namespace" r44972 isn't quite behaving transparently; non-view URLs are also being redirected to the raw view page, so for instance an ?action=edit or diff or whatever gets lost. See for example: http://en.wikipedia.org/wiki/Image:Wiki.png?action=edit http://en.wikipedia.org/wiki/Media:Wiki.png?action=edit these both currently behave just like: http://en.wikipedia.org/wiki/File:Wiki.png?action=edit while with this patch the Media: one would unexpectedly redirect to the view URL. The redirection should probably just be done where other existing normalization is... perhaps all that's actually needed is just to replace a Media: Title with the equivalent File: one when initializing the title in the first place, and the existing normalization-redirection will take care of it. --- includes/Wiki.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index ce5fd68c9e..9feeb0839d 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -218,10 +218,6 @@ class MediaWiki { } else if( NS_SPECIAL == $title->getNamespace() ) { /* actions that need to be made when we have a special pages */ SpecialPage::executePath( $title ); - } else if( NS_MEDIA == $title->getNamespace() ) { - global $wgOut; - $fileTitle = Title::makeTitle( NS_FILE, $title->getDBKey() ); - $wgOut->redirect( $fileTitle->getFullUrl() ); } else { /* Try low-level file cache hit */ if( $title->getNamespace() != NS_MEDIAWIKI && HTMLFileCache::useFileCache() ) { -- 2.20.1