From 2e17030282b861fe0cf6895ab36b3ae91a3d32b1 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 5 Apr 2009 15:01:25 +0000 Subject: [PATCH] Move the circular reference check to *after* redirect resolution, to avoid infinite loops via redirects. Was causing sysadmin issues. --- includes/parser/Parser.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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' ); } -- 2.20.1