moving wfProfileIn() to the start of the function, adding warning suppression like...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 23 Oct 2004 08:21:39 +0000 (08:21 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 23 Oct 2004 08:21:39 +0000 (08:21 +0000)
includes/GlobalFunctions.php

index a3d4fa0..3da1c53 100644 (file)
@@ -376,7 +376,11 @@ function wfMsgReal( $key, $args, $useDB, $forContent=false ) {
        static $replacementKeys = array( '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9' );
        global $wgParser, $wgMsgParserOptions;
        global $wgContLang, $wgLanguageCode;
-    if($forContent) {
+       
+       $fname = 'wfMsg';
+       wfProfileIn( $fname );
+       
+       if($forContent) {
         global $wgMessageCache;
         $cache = &$wgMessageCache;
         $lang = &$wgContLang;
@@ -394,12 +398,13 @@ function wfMsgReal( $key, $args, $useDB, $forContent=false ) {
                }
     }
 
-       $fname = 'wfMsg';
-       wfProfileIn( $fname );
+
        if ( is_object($cache) ) {
                $message = $cache->get( $key, $useDB, $forContent );
        } elseif (is_object($lang)) {
+               wfSuppressWarnings();
                $message = $lang->getMessage( $key );
+               wfRestoreWarnings();
                if(!$message)
                        $message = Language::getMessage($key);
                if(strstr($message, '{{' ) !== false) {