* @private
* @static
*/
- static function getRandomString() {
+ static private function getRandomString() {
return dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) );
}
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() {
function onClearState( &$parser ) {
// hack marker prefixes to get identical output
- $parser->mUniqPrefix = $this->dtUniqPrefix;
+ if ( !isset( $this->dtUniqPrefix ) ) {
+ $this->dtUniqPrefix = $parser->mUniqPrefix;
+ } else {
+ $parser->mUniqPrefix = $this->dtUniqPrefix;
+ }
return true;
}
}