Fail fast if given invalid input. We've had some of these in the past and they were...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 5 Aug 2010 16:40:50 +0000 (16:40 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 5 Aug 2010 16:40:50 +0000 (16:40 +0000)
includes/MessageCache.php

index 164ff62..fda8181 100644 (file)
@@ -499,6 +499,10 @@ class MessageCache {
        function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
                global $wgContLanguageCode, $wgContLang;
 
+               if ( !is_string( $key ) ) {
+                       throw new MWException( "Non-string key given" );
+               }
+
                if ( strval( $key ) === '' ) {
                        # Shortcut: the empty key is always missing
                        return false;