dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Don't hard-code Preferences page name"
[lhc/web/wiklou.git]
/
includes
/
libs
/
objectcache
/
MultiWriteBagOStuff.php
diff --git
a/includes/libs/objectcache/MultiWriteBagOStuff.php
b/includes/libs/objectcache/MultiWriteBagOStuff.php
index
687c67c
..
200ab79
100644
(file)
--- 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
*
/**
* Apply a write method to the first $count backing caches
*
- * @param int
eger
$count
+ * @param int $count
* @param bool $asyncWrites
* @param string $method
* @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 );
* @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
foreach ( $this->caches as $i => $cache ) {
if ( $i >= $count ) {
break; // ignore the lower tiers