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;
// Since we're not really outputting HTML, decode the entities and
// then re-encode the things that need hiding inside HTML comments.
$limitReport = htmlspecialchars_decode( $limitReport );
- Hooks::run( 'ParserLimitReport', [ $this, &$limitReport ] );
+ // Run deprecated hook
+ Hooks::run( 'ParserLimitReport', [ $this, &$limitReport ], '1.22' );
// Sanitize for comment. Note '‐' in the replacement is U+2010,
// which looks much like the problematic '-'.
$ig->setContextTitle( $this->mTitle );
$ig->setShowBytes( false );
+ $ig->setShowDimensions( false );
$ig->setShowFilename( false );
$ig->setParser( $this );
$ig->setHideBadImages();
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;