From: Bryan Tong Minh Date: Wed, 14 May 2008 11:52:59 +0000 (+0000) Subject: Add comments and explicit check for NS_IMAGE. X-Git-Tag: 1.31.0-rc.0~47638 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=09f03854854f59a8ae2351d92d8a2396d725fb6a;p=lhc%2Fweb%2Fwiklou.git Add comments and explicit check for NS_IMAGE. --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 4dacae30d8..399fc1cad0 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -44,10 +44,14 @@ class ImagePage extends Article { function view() { global $wgOut, $wgShowEXIF, $wgRequest, $wgUser; - if ( $this->img->getRedirected() ) { + if ( $this->mTitle->getNamespace() == NS_IMAGE && $this->img->getRedirected() ) { if ( $this->mTitle->getDBkey() == $this->img->getName() ) { + // mTitle is the same as the redirect target so ask Article + // to perform the redirect for us. return Article::view(); } else { + // mTitle is not the same as the redirect target so it is + // probably the redirect page itself. Fake the redirect symbol $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); $this->viewRedirect( Title::makeTitle( NS_IMAGE, $this->img->getName() ), /* $overwriteSubtitle */ true, /* $forceKnown */ true );