From: Mark A. Hershberger Date: Fri, 10 Feb 2012 19:46:38 +0000 (+0000) Subject: Fixes Bug 18775 - Redirect preview rendering stops prematurely, hides categories X-Git-Tag: 1.31.0-rc.0~24791 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=35b68b1102fbad84ae70f13edeff044f05c739b5;p=lhc%2Fweb%2Fwiklou.git Fixes Bug 18775 - Redirect preview rendering stops prematurely, hides categories Patch from Brad Jorsch. --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 415a29ae68..9c7a7c9ee2 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -2595,32 +2595,33 @@ HTML $previewHTML = $parserOutput->mText; $previewHTML .= "
\n" . htmlspecialchars( $this->textbox1 ) . "\n
\n"; } else { - $rt = Title::newFromRedirectArray( $this->textbox1 ); - if ( $rt ) { - $previewHTML = $this->mArticle->viewRedirect( $rt, false ); - } else { - $toparse = $this->textbox1; + $toparse = $this->textbox1; - # If we're adding a comment, we need to show the - # summary as the headline - if ( $this->section == "new" && $this->summary != "" ) { - $toparse = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $toparse; - } + # If we're adding a comment, we need to show the + # summary as the headline + if ( $this->section == "new" && $this->summary != "" ) { + $toparse = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $toparse; + } - wfRunHooks( 'EditPageGetPreviewText', array( $this, &$toparse ) ); + wfRunHooks( 'EditPageGetPreviewText', array( $this, &$toparse ) ); - $parserOptions->enableLimitReport(); + $parserOptions->enableLimitReport(); - $toparse = $wgParser->preSaveTransform( $toparse, $this->mTitle, $wgUser, $parserOptions ); - $parserOutput = $wgParser->parse( $toparse, $this->mTitle, $parserOptions ); + $toparse = $wgParser->preSaveTransform( $toparse, $this->mTitle, $wgUser, $parserOptions ); + $parserOutput = $wgParser->parse( $toparse, $this->mTitle, $parserOptions ); + $rt = Title::newFromRedirectArray( $this->textbox1 ); + if ( $rt ) { + $previewHTML = $this->mArticle->viewRedirect( $rt, false ); + } else { $previewHTML = $parserOutput->getText(); - $this->mParserOutput = $parserOutput; - $wgOut->addParserOutputNoText( $parserOutput ); + } - if ( count( $parserOutput->getWarnings() ) ) { - $note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() ); - } + $this->mParserOutput = $parserOutput; + $wgOut->addParserOutputNoText( $parserOutput ); + + if ( count( $parserOutput->getWarnings() ) ) { + $note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() ); } }