r48779 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48778‎ | r48779 | r48780 >
Date:02:07, 25 March 2009
Author:brion
Status:ok
Tags:
Comment:
Revert r48090 " * Modified wfMsg behaviour to do transform after substituting variables * If this works, wfMsg should now work similarly to wfMsgExt with parsemag"
While having the parser functions in the message strings work is a laudable goal, the problem here is that it'll *also* execute parser functions it finds in the replaced parameter strings, which may include, say, comment plaintext talking *about* parser functions.
A better fix for this is probably to expand the message placeholders when the parameters are passed in to the parser functions.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -559,13 +559,9 @@
560560 * @return String: the requested message.
561561 */
562562 function wfMsgReal( $key, $args, $useDB = true, $forContent=false, $transform = true ) {
563 - global $wgMessageCache;
564563 wfProfileIn( __METHOD__ );
565 - $message = wfMsgGetKey( $key, $useDB, $forContent, false );
 564+ $message = wfMsgGetKey( $key, $useDB, $forContent, $transform );
566565 $message = wfMsgReplaceArgs( $message, $args );
567 - if( $transform && is_object( $wgMessageCache ) ) {
568 - $message = $wgMessageCache->transform( $message, !$forContent );
569 - }
570566 wfProfileOut( __METHOD__ );
571567 return $message;
572568 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r48090* Modified wfMsg behaviour to do transform after substituting variables...nikerabbit12:19, 6 March 2009

Status & tagging log