From: Brion Vibber Date: Wed, 25 Mar 2009 02:07:09 +0000 (+0000) Subject: Revert r48090 " * Modified wfMsg behaviour to do transform after substituting variabl... X-Git-Tag: 1.31.0-rc.0~42381 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=6a55ea9598b2587bbadcde5549a85b3985d1e2cc;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2936a1e680..0807f0be52 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -559,13 +559,9 @@ function wfMsgNoDBForContent( $key ) { * @return String: the requested message. */ function wfMsgReal( $key, $args, $useDB = true, $forContent=false, $transform = true ) { - global $wgMessageCache; wfProfileIn( __METHOD__ ); - $message = wfMsgGetKey( $key, $useDB, $forContent, false ); + $message = wfMsgGetKey( $key, $useDB, $forContent, $transform ); $message = wfMsgReplaceArgs( $message, $args ); - if( $transform && is_object( $wgMessageCache ) ) { - $message = $wgMessageCache->transform( $message, !$forContent ); - } wfProfileOut( __METHOD__ ); return $message; }