X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FMultiWriteBagOStuff.php;h=65f3a8afe5adecd7ae46494857432c5ab14560bc;hb=ace44e2064851dda9d9e7327494bd7b7b3379825;hp=687c67c35629936acb10d4ed14201f2839bc26ee;hpb=10d1b7d12b5d097413cd507740c5c71781c2580b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/MultiWriteBagOStuff.php b/includes/libs/objectcache/MultiWriteBagOStuff.php index 687c67c356..65f3a8afe5 100644 --- a/includes/libs/objectcache/MultiWriteBagOStuff.php +++ b/includes/libs/objectcache/MultiWriteBagOStuff.php @@ -174,13 +174,19 @@ class MultiWriteBagOStuff extends BagOStuff { * @param integer $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