(Bug 16677) Media: view URLs should HTTP-redirect to canonical File: namespace

This commit is contained in:
Aaron Schulz 2008-12-23 21:05:33 +00:00
parent 7526a42586
commit d64229f145

View 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() ) {