From: Tim Starling Date: Sun, 5 Apr 2009 15:01:25 +0000 (+0000) Subject: Move the circular reference check to *after* redirect resolution, to avoid infinite... X-Git-Tag: 1.31.0-rc.0~42219 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=2e17030282b861fe0cf6895ab36b3ae91a3d32b1;p=lhc%2Fweb%2Fwiklou.git Move the circular reference check to *after* redirect resolution, to avoid infinite loops via redirects. Was causing sysadmin issues. --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 02f29cf6f1..0f57d571b2 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2855,12 +2855,6 @@ class Parser if($wgContLang->hasVariants() && $title->getArticleID() == 0){ $wgContLang->findVariantLink( $part1, $title, true ); } - # Do infinite loop check - if ( !$frame->loopCheck( $title ) ) { - $found = true; - $text = '' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . ''; - wfDebug( __METHOD__.": template loop broken at '$titleText'\n" ); - } # Do recursion depth check $limit = $this->mOptions->getMaxTemplateDepth(); if ( $frame->depth >= $limit ) { @@ -2910,6 +2904,14 @@ class Parser } $found = true; } + + # 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" ); + } wfProfileOut( __METHOD__ . '-loadtpl' ); }