X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FMultiWriteBagOStuff.php;h=200ab7969c9ad6de66febf9aba0e8c9df963c9fb;hb=c6acd961c37a7454d93e5c9a7ee1f9782a16abf4;hp=687c67c35629936acb10d4ed14201f2839bc26ee;hpb=3cb14f56bdf3271769a5866f9dcaad56bf873aea;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/MultiWriteBagOStuff.php b/includes/libs/objectcache/MultiWriteBagOStuff.php index 687c67c356..200ab7969c 100644 --- a/includes/libs/objectcache/MultiWriteBagOStuff.php +++ b/includes/libs/objectcache/MultiWriteBagOStuff.php @@ -171,16 +171,22 @@ class MultiWriteBagOStuff extends BagOStuff { /** * Apply a write method to the first $count backing caches * - * @param integer $count + * @param int $count * @param bool $asyncWrites * @param string $method - * @param mixed ... + * @param mixed $args,... * @return bool */ protected function doWrite( $count, $asyncWrites, $method /*, ... */ ) { $ret = true; $args = array_slice( func_get_args(), 3 ); + if ( $count > 1 && $asyncWrites ) { + // Deep-clone $args to prevent misbehavior when something writes an + // object to the BagOStuff then modifies it afterwards, e.g. T168040. + $args = unserialize( serialize( $args ) ); + } + foreach ( $this->caches as $i => $cache ) { if ( $i >= $count ) { break; // ignore the lower tiers