Index: includes/parser/Parser.php
===================================================================
--- includes/parser/Parser.php (revision 0)
+++ includes/parser/Parser.php (revision 0)
@@ -3012,10 +3012,15 @@
# Do infinite loop check
# This has to be done after redirect resolution to avoid infinite loops via redirects
- if ( !$frame->loopCheck( $title ) ) {
- $found = true;
- $text = '' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . '';
- wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
+ if ( !$frame->loopCheck( $title ) ) {
+ if ( !wfRunHooks( 'ParserOnTemplateLoopCheck', array( &$this, $title, &$checked ) ) ) {
+ $checked = false;
+ }
+ if(!$checked) {
+ $found = true;
+ $text = '' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . '';
+ wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
+ }
}
wfProfileOut( __METHOD__ . '-loadtpl' );
}
@@ -3111,6 +3116,10 @@
$this->mTplDomCache[$titleText] = false;
return array( false, $title );
}
+ if ( !wfRunHooks( 'ParserBeforeTemplateParse', array( &$this, $title, &$text ) ) ) {
+ wfProfileOut( __METHOD__ );
+ return array( false, $title );
+ }
$dom = $this->preprocessToDom( $text, self::PTD_FOR_INCLUSION );
$this->mTplDomCache[ $titleText ] = $dom;