From 3a4fcdab99187b3db3ad285704ab558e755cb955 Mon Sep 17 00:00:00 2001 From: Ilmari Karonen Date: Wed, 9 May 2007 17:53:45 +0000 Subject: [PATCH] move key normalization from wfMsgWeirdKey() to non-cache branch of wgMsgGetKey(), to eliminate redundancy with identical normalization already done by the message cache --- includes/GlobalFunctions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9f6dc8fd9d..d3d5b1fee1 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -429,8 +429,6 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent=false, $transform = * @param $key String: */ function wfMsgWeirdKey ( $key ) { - global $wgContLang; - $key = str_replace( ' ' , '_' , $wgContLang->lcfirst( $key ) ); $source = wfMsgGetKey( $key, false, true, false ); if ( wfEmptyMsg( $key, $source ) ) return ""; @@ -474,8 +472,11 @@ function wfMsgGetKey( $key, $useDB, $forContent = false, $transform = true ) { $lang = &$wgLang; } - wfSuppressWarnings(); + # MessageCache::get() does this already, Language::getMessage() doesn't + # ISSUE: Should we try to handle "message/lang" here too? + $key = str_replace( ' ' , '_' , $wgContLang->lcfirst( $key ) ); + wfSuppressWarnings(); if( is_object( $lang ) ) { $message = $lang->getMessage( $key ); } else { -- 2.20.1