From: Liangent Date: Fri, 28 Sep 2012 13:07:04 +0000 (+0800) Subject: Show redirects correctly on diff pages. X-Git-Tag: 1.31.0-rc.0~22067 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=15cd7d64f160c11975cff3e7fd23dd1ebdebf810;p=lhc%2Fweb%2Fwiklou.git Show redirects correctly on diff pages. Change-Id: Ic3c2d6cff016a8fecdde511e2d14b30426737c8a --- diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 18dcfe9e5a..d638c48ba8 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -544,8 +544,19 @@ class DifferenceEngine extends ContextSource { $parserOutput = $this->getParserOutput( $wikiPage, $this->mNewRev ); - # WikiPage::getParserOutput() should not return false, but just in case - if( $parserOutput ) { + # Also try to load it as a redirect + $rt = $this->mNewContent->getRedirectTarget(); + + if ( $rt ) { + $article = Article::newFromTitle( $this->mNewPage, $this->getContext() ); + $out->addHTML( $article->viewRedirect( $rt ) ); + + # WikiPage::getParserOutput() should not return false, but just in case + if ( $parserOutput ) { + # Show categories etc. + $out->addParserOutputNoText( $parserOutput ); + } + } else if ( $parserOutput ) { $out->addParserOutput( $parserOutput ); } }