Don't die on empty keys in MWMemcached
authorNiklas Laxström <niklas.laxstrom@gmail.com>
Wed, 23 Apr 2014 14:18:24 +0000 (14:18 +0000)
committerNiklas Laxström <niklas.laxstrom@gmail.com>
Thu, 5 Jun 2014 08:09:47 +0000 (08:09 +0000)
Bug: 64287
Change-Id: Iedfec96286212577a181b83957cdc4545be206d2

includes/objectcache/MemcachedClient.php

index 9de840b..7990053 100644 (file)
@@ -419,6 +419,12 @@ class MWMemcached {
                        $this->_debugprint( "get($key)\n" );
                }
 
+               if ( !is_array( $key ) && strval( $key ) === '' ) {
+                       $this->_debugprint( "Skipping key which equals to an empty string" );
+                       wfProfileOut( __METHOD__ );
+                       return false;
+               }
+
                if ( !$this->_active ) {
                        wfProfileOut( __METHOD__ );
                        return false;