r111193 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111192‎ | r111193 | r111194 >
Date:19:46, 10 February 2012
Author:mah
Status:ok (Comments)
Tags:
Comment:
Fixes Bug 18775 - Redirect preview rendering stops prematurely, hides categories
Patch from Brad Jorsch.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -2595,32 +2595,33 @@
25962596 $previewHTML = $parserOutput->mText;
25972597 $previewHTML .= "<pre class=\"$class\" dir=\"ltr\">\n" . htmlspecialchars( $this->textbox1 ) . "\n</pre>\n";
25982598 } else {
2599 - $rt = Title::newFromRedirectArray( $this->textbox1 );
2600 - if ( $rt ) {
2601 - $previewHTML = $this->mArticle->viewRedirect( $rt, false );
2602 - } else {
2603 - $toparse = $this->textbox1;
 2599+ $toparse = $this->textbox1;
26042600
2605 - # If we're adding a comment, we need to show the
2606 - # summary as the headline
2607 - if ( $this->section == "new" && $this->summary != "" ) {
2608 - $toparse = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $toparse;
2609 - }
 2601+ # If we're adding a comment, we need to show the
 2602+ # summary as the headline
 2603+ if ( $this->section == "new" && $this->summary != "" ) {
 2604+ $toparse = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $toparse;
 2605+ }
26102606
2611 - wfRunHooks( 'EditPageGetPreviewText', array( $this, &$toparse ) );
 2607+ wfRunHooks( 'EditPageGetPreviewText', array( $this, &$toparse ) );
26122608
2613 - $parserOptions->enableLimitReport();
 2609+ $parserOptions->enableLimitReport();
26142610
2615 - $toparse = $wgParser->preSaveTransform( $toparse, $this->mTitle, $wgUser, $parserOptions );
2616 - $parserOutput = $wgParser->parse( $toparse, $this->mTitle, $parserOptions );
 2611+ $toparse = $wgParser->preSaveTransform( $toparse, $this->mTitle, $wgUser, $parserOptions );
 2612+ $parserOutput = $wgParser->parse( $toparse, $this->mTitle, $parserOptions );
26172613
 2614+ $rt = Title::newFromRedirectArray( $this->textbox1 );
 2615+ if ( $rt ) {
 2616+ $previewHTML = $this->mArticle->viewRedirect( $rt, false );
 2617+ } else {
26182618 $previewHTML = $parserOutput->getText();
2619 - $this->mParserOutput = $parserOutput;
2620 - $wgOut->addParserOutputNoText( $parserOutput );
 2619+ }
26212620
2622 - if ( count( $parserOutput->getWarnings() ) ) {
2623 - $note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() );
2624 - }
 2621+ $this->mParserOutput = $parserOutput;
 2622+ $wgOut->addParserOutputNoText( $parserOutput );
 2623+
 2624+ if ( count( $parserOutput->getWarnings() ) ) {
 2625+ $note .= "\n\n" . implode( "\n\n", $parserOutput->getWarnings() );
26252626 }
26262627 }
26272628

Comments

#Comment by MarkAHershberger (talk | contribs)   13:23, 17 February 2012

Re-marking "ok" because it was moved from "ok" to "new" without explanation.

Status & tagging log