From: Tim Starling Date: Sat, 23 Oct 2004 08:21:39 +0000 (+0000) Subject: moving wfProfileIn() to the start of the function, adding warning suppression like... X-Git-Tag: 1.5.0alpha1~1494 X-Git-Url: http://git.cyclocoop.org/%27.%28%24current%20%3E%202?a=commitdiff_plain;h=5f3b51db0718d5438f4b73742d468d676c180d23;p=lhc%2Fweb%2Fwiklou.git moving wfProfileIn() to the start of the function, adding warning suppression like I did in MessageCache.php --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a3d4fa0fa6..3da1c53210 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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) {