X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FMultiWriteBagOStuff.php;h=d94578dff12e3dcc96f086b8ba7a74098ffe25c9;hp=687c67c35629936acb10d4ed14201f2839bc26ee;hb=36395150104588f2afea866c330b683e4329fa48;hpb=f7e1770fb832aa77bf4e16ce8cc815f2b24dd10d diff --git a/includes/libs/objectcache/MultiWriteBagOStuff.php b/includes/libs/objectcache/MultiWriteBagOStuff.php index 687c67c356..d94578dff1 100644 --- a/includes/libs/objectcache/MultiWriteBagOStuff.php +++ b/includes/libs/objectcache/MultiWriteBagOStuff.php @@ -181,6 +181,12 @@ class MultiWriteBagOStuff extends BagOStuff { $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