From: Bryan Tong Minh Date: Thu, 8 May 2008 21:25:12 +0000 (+0000) Subject: So actually Article::followRedirect is used instead of Article::getRedirectTarget... X-Git-Tag: 1.31.0-rc.0~47800 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=7648748feda4a5ea753bc8cfd3682c9ab0449cc2;p=lhc%2Fweb%2Fwiklou.git So actually Article::followRedirect is used instead of Article::getRedirectTarget. Override this in ImagePage to make foreign image redirects work on image pages. --- 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