revert r111028 (attempt to fix bug 34254)
[lhc/web/wiklou.git] / includes / parser / Parser_DiffTest.php
index b6a7367..efad33f 100644 (file)
@@ -13,14 +13,13 @@ class Parser_DiffTest
        var $parsers, $conf;
        var $shortOutput = false;
 
-       var $dfUniqPrefix;
+       var $dtUniqPrefix;
 
        function __construct( $conf ) {
                if ( !isset( $conf['parsers'] ) ) {
                        throw new MWException( __METHOD__ . ': no parsers specified' );
                }
                $this->conf = $conf;
-               $this->dtUniqPrefix = "\x7fUNIQ" . Parser::getRandomString();
        }
 
        function init() {
@@ -112,9 +111,17 @@ class Parser_DiffTest
                }
        }
 
+       /**
+        * @param $parser Parser
+        * @return bool
+        */
        function onClearState( &$parser ) {
                // hack marker prefixes to get identical output
-               $parser->mUniqPrefix = $this->dtUniqPrefix;
+               if ( !isset( $this->dtUniqPrefix ) ) {
+                       $this->dtUniqPrefix = $parser->uniqPrefix();
+               } else {
+                       $parser->mUniqPrefix = $this->dtUniqPrefix;
+               }
                return true;
        }
 }