From: Platonides Date: Fri, 15 Oct 2010 22:12:19 +0000 (+0000) Subject: Follow r69904. Make Parser::getRandomString real private. X-Git-Tag: 1.31.0-rc.0~34488 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=405bc4d9988e07354dd8fcb8034c7fb9484a1fb6;p=lhc%2Fweb%2Fwiklou.git Follow r69904. Make Parser::getRandomString real private. Parser_DiffTest::dtUniqPrefix is now lazyloader. I also fixed the typo in its declaration. --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 26be8b9d43..fe6dbfb5a4 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -494,7 +494,7 @@ class Parser { * @private * @static */ - static function getRandomString() { + static private function getRandomString() { return dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) ); } diff --git a/includes/parser/Parser_DiffTest.php b/includes/parser/Parser_DiffTest.php index b6a7367112..ef98fe0bba 100644 --- a/includes/parser/Parser_DiffTest.php +++ b/includes/parser/Parser_DiffTest.php @@ -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() { @@ -114,7 +113,11 @@ class Parser_DiffTest 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; } }