From 0b9b787acf21fcc789d1702a0801757f3a8a399b Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 15 Sep 2011 11:12:19 +0000 Subject: [PATCH] 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. --- includes/cache/MessageCache.php | 5 +++++ 1 file changed, 5 insertions(+) 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' ); } -- 2.20.1