Fix default $oldOpts from 09cbebb224
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 8 Oct 2015 03:26:38 +0000 (20:26 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 8 Oct 2015 03:26:38 +0000 (20:26 -0700)
This fixes the default $oldOpts value for the case when
$opts is given check keys and no $oldOpts value is passed
in. In that case, the getWithSetCallback() method
variable $opts would be null instead of array().

Change-Id: I825062533478b37766511aae1d06dd4b81f8dba1

includes/libs/objectcache/WANObjectCache.php

index 70f2af2..fefecdf 100644 (file)
@@ -640,7 +640,7 @@ class WANObjectCache {
         * @return mixed Value to use for the key
         */
        final public function getWithSetCallback(
         * @return mixed Value to use for the key
         */
        final public function getWithSetCallback(
-               $key, $ttl, $callback, array $opts = array(), $oldOpts = null
+               $key, $ttl, $callback, array $opts = array(), $oldOpts = array()
        ) {
                // Back-compat with 1.26: Swap $ttl and $callback
                if ( is_int( $callback ) ) {
        ) {
                // Back-compat with 1.26: Swap $ttl and $callback
                if ( is_int( $callback ) ) {