Merge r82361 from 1.17wmf1 to trunk. This shuts up "Non-string key given" exceptions...
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 15 Sep 2011 11:12:19 +0000 (11:12 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 15 Sep 2011 11:12:19 +0000 (11:12 +0000)
includes/cache/MessageCache.php

index 6964479..3f787e9 100644 (file)
@@ -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' );
                }