r49212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49211‎ | r49212 | r49213 >
Date:15:01, 5 April 2009
Author:tstarling
Status:ok (Comments)
Tags:
Comment:
Move the circular reference check to *after* redirect resolution, to avoid infinite loops via redirects. Was causing sysadmin issues.
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -2855,12 +2855,6 @@
28562856 if($wgContLang->hasVariants() && $title->getArticleID() == 0){
28572857 $wgContLang->findVariantLink( $part1, $title, true );
28582858 }
2859 - # Do infinite loop check
2860 - if ( !$frame->loopCheck( $title ) ) {
2861 - $found = true;
2862 - $text = '<span class="error">' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . '</span>';
2863 - wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
2864 - }
28652859 # Do recursion depth check
28662860 $limit = $this->mOptions->getMaxTemplateDepth();
28672861 if ( $frame->depth >= $limit ) {
@@ -2910,6 +2904,14 @@
29112905 }
29122906 $found = true;
29132907 }
 2908+
 2909+ # Do infinite loop check
 2910+ # This has to be done after redirect resolution to avoid infinite loops via redirects
 2911+ if ( !$frame->loopCheck( $title ) ) {
 2912+ $found = true;
 2913+ $text = '<span class="error">' . wfMsgForContent( 'parser-template-loop-warning', $titleText ) . '</span>';
 2914+ wfDebug( __METHOD__.": template loop broken at '$titleText'\n" );
 2915+ }
29142916 wfProfileOut( __METHOD__ . '-loadtpl' );
29152917 }
29162918

Follow-up revisions

RevisionCommit summaryAuthorDate
r50169Added release notes entry for user-visible change r49212: fix for template lo...tstarling09:42, 4 May 2009
r50170Backported r49212/r50169: template loop check didn't work when redirects were...tstarling09:46, 4 May 2009

Comments

#Comment by Tim Starling (talk | contribs)   09:47, 4 May 2009

Old bug,

Status & tagging log