Merge "Use <div> wrappers instead of <p> in ProtectionForm"
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 4636ba3..e10a530 100644 (file)
@@ -369,6 +369,11 @@ class MediaWiki {
                        }
                        throw new HttpError( 500, $message );
                }
+               // Protect against redirects to NS_MEDIA namespace
+               // when the user probably wants NS_FILE
+               if ( $title->inNamespace( NS_MEDIA ) ) {
+                       $title->mNamespace = NS_FILE;
+               }
                $output->setCdnMaxage( 1200 );
                $output->redirect( $targetUrl, '301' );
                return true;