r101291 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101290‎ | r101291 | r101292 >
Date:22:22, 29 October 2011
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/parser/parserTests.txt
@@ -8795,12 +8795,12 @@
87968796
87978797 !! test
87988798 Bug 31098 Template which includes system messages which includes the template
8799 -!! options
8800 -disabled
88018799 !! input
88028800 {{Identical}}
88038801 !! result
8804 -...
 8802+<p><span class="error">Template loop detected: <a href="https://www.mediawiki.org/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
 8803+<span class="error">Template loop detected: <a href="https://www.mediawiki.org/wiki/Template:Identical" title="Template:Identical">Template:Identical</a></span>
 8804+</p>
88058805 !! end
88068806
88078807 !! test
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -98,8 +98,7 @@
9999 if ( strval( $part1 ) !== '' ) {
100100 $args = array_slice( func_get_args(), 2 );
101101 $message = wfMessage( $part1, $args )->inLanguage( $parser->getOptions()->getUserLangObj() )->plain();
102 - $message = $parser->replaceVariables( $message ); // like MessageCache::transform()
103 - return $message;
 102+ return array( $message, 'noparse' => false );
104103 } else {
105104 return array( 'found' => false );
106105 }

Sign-offs

UserFlagDate
Aaron Schulzinspected22:34, 29 October 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r102440Attempt to fix translatewiki bug 32057...platonides20:58, 8 November 2011
r102454Test for bug 32057....platonides21:55, 8 November 2011
r102548MFT r101291 and r102454...platonides17:53, 9 November 2011
r1025921.18wmf1 MFT r100575, r101291, r101314...reedy23:00, 9 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97821Parser test for bug 31098, disabled of coursenikerabbit16:00, 22 September 2011
r97849Re-do r96798 ("LanguageConverter now depends on the page content language"), ...robin20:31, 22 September 2011

Comments

#Comment by Platonides (talk | contribs)   22:45, 29 October 2011

1.17 is also affected. May be appropiate to backport, in case there's a new release later.

#Comment by Nikerabbit (talk | contribs)   08:51, 8 November 2011

Should check if bug 32057 and this are related.

#Comment by Nikerabbit (talk | contribs)   08:59, 8 November 2011

They are.

#Comment by Catrope (talk | contribs)   21:42, 8 November 2011

Un-fixme'ing since bug 32057 was fixed in r102440.

Status & tagging log