In the $clearState=true case, remove strip marker prefixes from the Parser::parse...
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 16 Mar 2012 00:29:26 +0000 (00:29 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 16 Mar 2012 00:29:26 +0000 (00:29 +0000)
Also cleaned up some old commented-out code in this area.

includes/parser/Parser.php

index 3dff643..e09e757 100644 (file)
@@ -273,8 +273,6 @@ class Parser {
                 * 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 @@ class Parser {
 
                $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;