Revert r48090 " * Modified wfMsg behaviour to do transform after substituting variabl...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 25 Mar 2009 02:07:09 +0000 (02:07 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 25 Mar 2009 02:07:09 +0000 (02:07 +0000)
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.

includes/GlobalFunctions.php

index 2936a1e..0807f0b 100644 (file)
@@ -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;
 }