r82473 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82472‎ | r82473 | r82474 >
Date:19:18, 19 February 2011
Author:mah
Status:ok (Comments)
Tags:
Comment:
(Bug #27467) preload can leave UNIQ

Patch to fix from P.Copp
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -329,8 +329,8 @@
330330
331331 /**
332332 * A converted title will be provided in the output object if title and
333 - * content conversion are enabled, the article text does not contain
334 - * a conversion-suppressing double-underscore tag, and no
 333+ * content conversion are enabled, the article text does not contain
 334+ * a conversion-suppressing double-underscore tag, and no
335335 * {{DISPLAYTITLE:...}} is present. DISPLAYTITLE takes precedence over
336336 * automatic link conversion.
337337 */
@@ -483,7 +483,9 @@
484484
485485 $flags = PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES;
486486 $dom = $this->preprocessToDom( $text, self::PTD_FOR_INCLUSION );
487 - return $this->getPreprocessor()->newFrame()->expand( $dom, $flags );
 487+ $text = $this->getPreprocessor()->newFrame()->expand( $dom, $flags );
 488+ $text = $this->mStripState->unstripBoth( $text );
 489+ return $text;
488490 }
489491
490492 /**
@@ -4095,7 +4097,7 @@
40964098 # Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags
40974099 $text = $this->replaceVariables( $text );
40984100
4099 - # This works almost by chance, as the replaceVariables are done before the getUserSig(),
 4101+ # This works almost by chance, as the replaceVariables are done before the getUserSig(),
41004102 # which may corrupt this parser instance via its wfMsgExt( parsemag ) call-
41014103
41024104 # Signatures
@@ -4984,9 +4986,9 @@
49854987 }
49864988
49874989 /**
4988 - * This function returns $oldtext after the content of the section
 4990+ * This function returns $oldtext after the content of the section
49894991 * specified by $section has been replaced with $text.
4990 - *
 4992+ *
49914993 * @param $text String: former text of the article
49924994 * @param $section Numeric: section identifier
49934995 * @param $text String: replacing text

Sign-offs

UserFlagDate
Catropeinspected20:27, 21 February 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r826781.17wmf1: MFT r82473, r82572, r82574, r82601, r82608, r82654catrope16:34, 23 February 2011
r85211MFT: r82297, r82307, r82309, r82312, r82315, r82337, r82391, r82392, r82403, ...demon21:01, 2 April 2011
r100599test that preloaded text is unstripped...hashar10:51, 24 October 2011

Comments

#Comment by Platonides (talk | contribs)   20:26, 19 February 2011

Needs tests

#Comment by MarkAHershberger (talk | contribs)   21:36, 19 February 2011

tagged as such.

#Comment by Catrope (talk | contribs)   20:26, 21 February 2011

Looks good to me, but I'd like to have Tim look at this.

#Comment by Tim Starling (talk | contribs)   00:26, 22 February 2011

What's wrong with just using Parser::preprocess()?

#Comment by MarkAHershberger (talk | contribs)   01:17, 22 February 2011

preprocess() removes the comments and expands templates, getPreloadText() isn't supposed to.

#Comment by Tim Starling (talk | contribs)   01:32, 22 February 2011

Oops, did I say that out loud? I meant to delete that comment before I changed the status.

#Comment by Hashar (talk | contribs)   10:52, 24 October 2011

Removing tag 'needs-php-test'. Tests added with r100599

Status & tagging log