From: Aaron Schulz Date: Tue, 23 Dec 2008 21:05:33 +0000 (+0000) Subject: (Bug 16677) Media: view URLs should HTTP-redirect to canonical File: namespace X-Git-Tag: 1.31.0-rc.0~43812 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=d64229f1458ea32cb69e9d1ca770ec4790c628f7;p=lhc%2Fweb%2Fwiklou.git (Bug 16677) Media: view URLs should HTTP-redirect to canonical File: namespace --- diff --git a/includes/Wiki.php b/includes/Wiki.php index c5f745d3c1..2e00cdeba7 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -218,6 +218,10 @@ 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() ) {