continue;
}
$name = $matches[1];
+ $lowerName = strtolower( $name );
$attrStart = $i + strlen( $name ) + 1;
// Find end of tag
}
// Handle ignored tags
- if ( in_array( $name, $ignoredTags ) ) {
+ if ( in_array( $lowerName, $ignoredTags ) ) {
$accum .= '<ignore>' . htmlspecialchars( substr( $text, $i, $tagEndPos - $i + 1 ) ) . '</ignore>';
$i = $tagEndPos + 1;
continue;
}
}
// <includeonly> and <noinclude> just become <ignore> tags
- if ( in_array( $name, $ignoredElements ) ) {
+ if ( in_array( $lowerName, $ignoredElements ) ) {
$accum .= '<ignore>' . htmlspecialchars( substr( $text, $tagStartPos, $i - $tagStartPos ) )
. '</ignore>';
continue;
}
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];
}