PHP Notice: Undefined offset with default bucket
I dropped in memcached for some tests in a multisite installation (WordPress 3.4.1). I get a PHP Notice (Undefined offset: 1 in /wp-content/object-cache.php on line 374″).
In line 365 the plugin defines the default bucket:
$buckets = array('127.0.0.1');
and tries this in line 374:
list ( $node, $port ) = explode(':', $server);
where $server is ‘127.0.0.1’.
I changed the assignement for the default bucket to:
$buckets = array('127.0.0.1:' . ini_get('memcache.default_port'));
to fix the undefined offset.
I would love to get some feedback. Is this safe to do? If yes, maybe we could consider to add this in the next release of memcached?
- The topic ‘PHP Notice: Undefined offset with default bucket’ is closed to new replies.