From 07120a507723cb4711832d00c7e9f3c3fa805af8 Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Sun, 20 Jan 2008 08:18:45 +0000 Subject: [PATCH] * Fix empty file histories * Fix Media: links to image redirects --- includes/ImagePage.php | 2 +- includes/filerepo/LocalRepo.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 0d20799125..b722903915 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -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(); diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index 92aa9e5669..8601881715 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -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 ) { -- 2.20.1