From 5f3b51db0718d5438f4b73742d468d676c180d23 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 23 Oct 2004 08:21:39 +0000 Subject: [PATCH] moving wfProfileIn() to the start of the function, adding warning suppression like I did in MessageCache.php --- includes/GlobalFunctions.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) { -- 2.20.1