From 7648748feda4a5ea753bc8cfd3682c9ab0449cc2 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Thu, 8 May 2008 21:25:12 +0000 Subject: [PATCH] So actually Article::followRedirect is used instead of Article::getRedirectTarget. Override this in ImagePage to make foreign image redirects work on image pages. --- includes/ImagePage.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 5013adb9a8..887f2dc2f8 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -112,6 +112,13 @@ class ImagePage extends Article { $from = $this->img->getRedirected(); return $this->mRedirectTarget = Title::makeTitle( NS_IMAGE, $from ); } + public function followRedirect() { + if ( $this->img->isLocal() ) + return parent::followRedirect(); + + $from = $this->img->getRedirected(); + return Title::makeTitle( NS_IMAGE, $from ); + } /** * Create the TOC -- 2.20.1