*/
function memCheck() {
if ( $this->memoryLimit === false ) {
- return;
+ return true;
}
$usage = memory_get_usage();
if ( $usage > $this->memoryLimit * 0.9 ) {
if ( !$result ) {
// Try running the XML through UtfNormal to get rid of invalid characters
$xml = UtfNormal::cleanUp( $xml );
- $result = $dom->loadXML( $xml );
+ // 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2 don't barf when the XML is >256 levels deep
+ $result = $dom->loadXML( $xml, 1 << 19 );
if ( !$result ) {
throw new MWException( __METHOD__.' generated invalid XML' );
}
'open' => $curChar,
'close' => $rule['end'],
'count' => $count,
- 'lineStart' => ($i == 0 || $text[$i-1] == "\n"),
+ 'lineStart' => ($i > 0 && $text[$i-1] == "\n"),
);
$stack->push( $piece );
return $root;
}
- if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->getMaxPPNodeCount() )
- {
+ if ( ++$this->parser->mPPNodeCount > $this->parser->mOptions->getMaxPPNodeCount() ) {
return '<span class="error">Node-count limit exceeded</span>';
}
/**
* Virtual implode with brackets
+ * @return array
*/
function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) {
$args = array_slice( func_get_args(), 3 );
function isTemplate() {
return false;
}
+
+ /**
+ * Get a title of frame
+ *
+ * @return Title
+ */
+ function getTitle() {
+ return $this->title;
+ }
}
/**
/**
* Split a <h> node
+ * @return array
*/
function splitHeading() {
if ( $this->getName() !== 'h' ) {