https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113981
Revision: 113981
Author: tstarling
Date: 2012-03-16 00:29:26 +0000 (Fri, 16 Mar 2012)
Log Message:
-----------
In the $clearState=true case, remove strip marker prefixes from the
Parser::parse() input. It's only possible for strip markers to be present in
this case if the caller manages to guess the output of
Parser::getRandomString() in advance. Even if that is possible, it's not
recommended as a robust calling procedure.
Also cleaned up some old commented-out code in this area.
Modified Paths:
--------------
trunk/phase3/includes/parser/Parser.php
Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php 2012-03-16 00:16:42 UTC (rev
113980)
+++ trunk/phase3/includes/parser/Parser.php 2012-03-16 00:29:26 UTC (rev
113981)
@@ -273,8 +273,6 @@
* Must not consist of all title characters, or else it will
change
* the behaviour of <nowiki> in a link.
*/
- # $this->mUniqPrefix = "\x07UNIQ" . Parser::getRandomString();
- # Changed to \x7f to allow XML double-parsing -- TS
$this->mUniqPrefix = "\x7fUNIQ" . self::getRandomString();
$this->mStripState = new StripState( $this->mUniqPrefix );
@@ -328,6 +326,11 @@
$this->startParse( $title, $options, self::OT_HTML, $clearState
);
+ # Remove the strip marker tag prefix from the input, if present.
+ if ( $clearState ) {
+ $text = str_replace( $this->mUniqPrefix, '', $text );
+ }
+
$oldRevisionId = $this->mRevisionId;
$oldRevisionObject = $this->mRevisionObject;
$oldRevisionTimestamp = $this->mRevisionTimestamp;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs