X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=34f62324e076a31b6d1bd9d7af72a955522e2bad;hp=ecee0e22d34c6b86630c647b4d1bebc107a1e02e;hb=7f3d6713e7191c476adb3d3c30344a0327b853d3;hpb=ed92b00ea5b1af2638948beaf334bc28e22ff4b6 diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ecee0e22d3..34f62324e0 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -245,7 +245,7 @@ class Parser { public $currentRevisionCache; /** - * @var bool Recursive call protection. + * @var bool|string Recursive call protection. * This variable should be treated as if it were private. */ public $mInParse = false; @@ -4400,7 +4400,6 @@ class Parser { $toc = Linker::tocList( $toc, $this->mOptions->getUserLangObj() ); $this->mOutput->setTOCHTML( $toc ); $toc = self::TOC_START . $toc . self::TOC_END; - $this->mOutput->addModules( 'mediawiki.toc' ); } if ( $isMain ) { @@ -6073,9 +6072,13 @@ class Parser { protected function lock() { if ( $this->mInParse ) { throw new MWException( "Parser state cleared while parsing. " - . "Did you call Parser::parse recursively?" ); + . "Did you call Parser::parse recursively? Lock is held by: " . $this->mInParse ); } - $this->mInParse = true; + + // Save the backtrace when locking, so that if some code tries locking again, + // we can print the lock owner's backtrace for easier debugging + $e = new Exception; + $this->mInParse = $e->getTraceAsString(); $recursiveCheck = new ScopedCallback( function() { $this->mInParse = false;