* Fix empty file histories
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 20 Jan 2008 08:18:45 +0000 (08:18 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 20 Jan 2008 08:18:45 +0000 (08:18 +0000)
* Fix Media: links to image redirects

includes/ImagePage.php
includes/filerepo/LocalRepo.php

index 0d20799..b722903 100644 (file)
@@ -411,7 +411,7 @@ EOT
 
                $sk = $wgUser->getSkin();
 
-               if ( $this->img ) {
+               if ( $this->img->exists ) {
                        $list = new ImageHistoryList( $sk, $this->img );
                        $file = $this->img;
                        $dims = $file->getDimensionsString();
index 92aa9e5..8601881 100644 (file)
@@ -89,6 +89,10 @@ class LocalRepo extends FSRepo {
                if( !$wgFileRedirects ) {
                        return false;
                }
+
+               if( $title->getNamespace() == NS_MEDIA ) {
+                       $title = Title::makeTitle( NS_IMAGE, $title->getText() );
+               }
                
                $id = $this->getArticleID( $title );
                if( !$id ) {