(Bug 16677) Media: view URLs should HTTP-redirect to canonical File: namespace
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 23 Dec 2008 21:05:33 +0000 (21:05 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 23 Dec 2008 21:05:33 +0000 (21:05 +0000)
includes/Wiki.php

index c5f745d..2e00cde 100644 (file)
@@ -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() ) {