From: Platonides Date: Sat, 29 Oct 2011 22:22:51 +0000 (+0000) Subject: Bug 31098: Template loop through MediaWiki: messages (int: function) not being detected. X-Git-Tag: 1.31.0-rc.0~26823 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=dc38ecd003639e72e2963512b248e9c8b6332253;p=lhc%2Fweb%2Fwiklou.git Bug 31098: Template loop through MediaWiki: messages (int: function) not being detected. The trick is not to replaceVariables() ourselves, but to leave that to the preprocessor, which is then correctly detecting the loop. --- diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 70e9b01ae0..cd5e0a5665 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -98,8 +98,7 @@ class CoreParserFunctions { if ( strval( $part1 ) !== '' ) { $args = array_slice( func_get_args(), 2 ); $message = wfMessage( $part1, $args )->inLanguage( $parser->getOptions()->getUserLangObj() )->plain(); - $message = $parser->replaceVariables( $message ); // like MessageCache::transform() - return $message; + return array( $message, 'noparse' => false ); } else { return array( 'found' => false ); } diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index e96f724d77..390ad06828 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -8795,12 +8795,12 @@ Template:Identical !! test Bug 31098 Template which includes system messages which includes the template -!! options -disabled !! input {{Identical}} !! result -... +

Template loop detected: Template:Identical +Template loop detected: Template:Identical +

!! end !! test