* Don't follow redirects if image exists
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 20 Jan 2008 16:05:44 +0000 (16:05 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 20 Jan 2008 16:05:44 +0000 (16:05 +0000)
includes/Wiki.php

index 2a60262..e0a5744 100644 (file)
@@ -249,7 +249,8 @@ class MediaWiki {
 
                // Namespace might change when using redirects
                if( ( $action == 'view' || $action == 'render' ) && !$request->getVal( 'oldid' ) &&
-                                               $request->getVal( 'redirect' ) != 'no' ) {
+                                               $request->getVal( 'redirect' ) != 'no' &&
+                                               !( $wgTitle->getNamespace() == NS_IMAGE && wfFindFile( $wgTitle->getText() ) ) ) {
 
                        $dbr = wfGetDB(DB_SLAVE);
                        $article->loadPageData($article->pageDataFromTitle($dbr, $title));