From: Tim Starling Date: Fri, 10 Jul 2009 11:54:32 +0000 (+0000) Subject: Made wfMsg('') and wfMsg(null) silently return <> as it did before r52503.... X-Git-Tag: 1.31.0-rc.0~41012 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=f0b42f5f64b965fcc64b8f7bda96e39043807b88;p=lhc%2Fweb%2Fwiklou.git Made wfMsg('') and wfMsg(null) silently return <> as it did before r52503. Thanks to those who supplied backtraces. --- diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 458ec8fd80..351c65d7cb 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -501,10 +501,9 @@ class MessageCache { function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { global $wgContLanguageCode, $wgContLang; - if ( !is_string( $key ) ) { - throw new MWException( __METHOD__.': Invalid message key of type ' . gettype( $key ) ); - } elseif ( $key === '' ) { - throw new MWException( __METHOD__.': Invaild message key: empty string' ); + if ( strval( $key ) === '' ) { + # Shortcut: the empty key is always missing + return '<>'; } $lang = wfGetLangObj( $langcode );