git-svn-id: http://svn.automattic.com/wordpress/trunk@9740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f6dfabee5b
commit
f6c2de0141
|
@ -313,7 +313,10 @@ class WP_Object_Cache {
|
|||
|
||||
if (isset ($this->cache[$group][$id])) {
|
||||
$this->cache_hits += 1;
|
||||
return $this->cache[$group][$id];
|
||||
if ( is_object($this->cache[$group][$id]) )
|
||||
return wp_clone($this->cache[$group][$id]);
|
||||
else
|
||||
return $this->cache[$group][$id];
|
||||
}
|
||||
|
||||
if ( isset ($this->non_existant_objects[$group][$id]) )
|
||||
|
@ -373,6 +376,9 @@ class WP_Object_Cache {
|
|||
if (NULL === $data)
|
||||
$data = '';
|
||||
|
||||
if ( is_object($data) )
|
||||
$data = wp_clone($data);
|
||||
|
||||
$this->cache[$group][$id] = $data;
|
||||
|
||||
if(isset($this->non_existant_objects[$group][$id]))
|
||||
|
|
|
@ -2872,4 +2872,9 @@ function wp_suspend_cache_invalidation($suspend = true) {
|
|||
return $current_suspend;
|
||||
}
|
||||
|
||||
function wp_clone($object) {
|
||||
return version_compare(phpversion(), '5.0') < 0 ? $object : clone($object);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue