Skip to content

Instantly share code, notes, and snippets.

@jeffstieler
Created September 20, 2013 18:41
Show Gist options
  • Select an option

  • Save jeffstieler/6641955 to your computer and use it in GitHub Desktop.

Select an option

Save jeffstieler/6641955 to your computer and use it in GitHub Desktop.
Index: object-cache.php
===================================================================
--- object-cache.php (revision 776128)
+++ object-cache.php (working copy)
@@ -208,10 +208,7 @@
$mc =& $this->get_mc($group);
if ( isset($this->cache[$key]) && ( !$force || in_array($group, $this->no_mc_groups) ) ) {
- if ( is_object( $this->cache[$key] ) )
- $value = clone $this->cache[$key];
- else
- $value = $this->cache[$key];
+ $value = $this->cache[$key];
} else if ( in_array($group, $this->no_mc_groups) ) {
$this->cache[$key] = $value = false;
} else {
@@ -227,6 +224,8 @@
if ( 'checkthedatabaseplease' === $value ) {
unset( $this->cache[$key] );
$value = false;
+ } else if ( is_object( $value ) ) {
+ $value = clone $value;
}
return $value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment