}
function expand( $root, $flags = 0 ) {
+ static $depth = 0;
if ( is_string( $root ) ) {
return $root;
}
return '<span class="error">Node-count limit exceeded</span>';
}
+ if ( $depth > $this->parser->mOptions->mMaxPPExpandDepth ) {
+ return '<span class="error">Expansion depth limit exceeded</span>';
+ }
+ ++$depth;
+
if ( $root instanceof PPNode_DOM ) {
$root = $root->node;
}
$titleText = $this->title->getPrefixedDBkey();
$this->parser->mHeadings[] = array( $titleText, $headingIndex );
$serial = count( $this->parser->mHeadings ) - 1;
- $marker = "{$this->parser->mUniqPrefix}-h-$serial-{$this->parser->mMarkerSuffix}";
+ $marker = "{$this->parser->mUniqPrefix}-h-$serial-" . Parser::MARKER_SUFFIX;
$count = $contextNode->getAttribute( 'level' );
$s = substr( $s, 0, $count ) . $marker . substr( $s, $count );
$this->parser->mStripState->general->setPair( $marker, '' );
}
}
}
+ --$depth;
return $outStack[0];
}