Verify parameter for MapCacheLRU::has() can be passed to array_key_exists()
[lhc/web/wiklou.git] / includes / libs / MapCacheLRU.php
index 0b6db32..b0cb078 100644 (file)
@@ -74,7 +74,11 @@ class MapCacheLRU {
         * @return bool
         */
        public function has( $key ) {
-               return array_key_exists( $key, $this->cache );
+               if ( is_string( $key ) || is_integer( $key ) ) {
+                       return array_key_exists( $key, $this->cache );
+               }
+               wfWarn( __METHOD__ . ": Key passed isn't a string or an integer.", 2 );
+               return false;
        }
 
        /**