From 15cd7d64f160c11975cff3e7fd23dd1ebdebf810 Mon Sep 17 00:00:00 2001 From: Liangent Date: Fri, 28 Sep 2012 21:07:04 +0800 Subject: [PATCH] Show redirects correctly on diff pages. Change-Id: Ic3c2d6cff016a8fecdde511e2d14b30426737c8a --- includes/diff/DifferenceEngine.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 ); } } -- 2.20.1