Add comments and explicit check for NS_IMAGE.
This commit is contained in:
parent
b1585c7942
commit
09f0385485
1 changed files with 5 additions and 1 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue