From: Roan Kattouw Date: Thu, 15 Sep 2011 11:12:19 +0000 (+0000) Subject: Merge r82361 from 1.17wmf1 to trunk. This shuts up "Non-string key given" exceptions... X-Git-Tag: 1.31.0-rc.0~27649 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_del%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=0b9b787acf21fcc789d1702a0801757f3a8a399b;p=lhc%2Fweb%2Fwiklou.git Merge r82361 from 1.17wmf1 to trunk. This shuts up "Non-string key given" exceptions in cases where a numeric key manages to become an integer somehow. This could probably be fixed in a better way but I wouldn't know how. --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 69644792af..3f787e907f 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -584,6 +584,11 @@ class MessageCache { function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { global $wgLanguageCode, $wgContLang; + if ( is_int( $key ) ) { + // "Non-string key given" exception sometimes happens for numerical strings that become ints somewhere on their way here + $key = strval( $key ); + } + if ( !is_string( $key ) ) { throw new MWException( 'Non-string key given' ); }