diff --git a/HeaderFooter.class.php b/HeaderFooter.class.php index 45bad84..d266cf9 100644 --- a/HeaderFooter.class.php +++ b/HeaderFooter.class.php @@ -14,10 +14,14 @@ public static function hOutputPageParserOutput( &$op, $parserOutput ) { return true; } - global $wgTitle; + $title = $op->getTitle(); + if ( $title->isRedirect() ) { + $article = Article::newFromID( $title->getArticleID() ); + $title = $article->getRedirectTarget(); + } - $ns = $wgTitle->getNsText(); - $name = $wgTitle->getPrefixedDBKey(); + $ns = $title->getNsText(); + $name = $title->getPrefixedDBKey(); $text = $parserOutput->getText(); @@ -69,4 +73,4 @@ static function conditionalInclude( &$text, $disableWord, &$msgId ) { return $msgText; } -} \ No newline at end of file +}