Make WordPress Core


Ignore:
Timestamp:
11/17/2008 09:01:12 PM (18 years ago)
Author:
ryan
Message:

Use clone to break object refs when setting and getting cache. see #8146 #8191

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cache.php

    r8742 r9740  
    314314                if (isset ($this->cache[$group][$id])) {
    315315                        $this->cache_hits += 1;
    316                         return $this->cache[$group][$id];
     316                        if ( is_object($this->cache[$group][$id]) )
     317                                return wp_clone($this->cache[$group][$id]);
     318                        else
     319                                return $this->cache[$group][$id];
    317320                }
    318321
    … …  
    373376                if (NULL === $data)
    374377                        $data = '';
     378
     379                if ( is_object($data) )
     380                        $data = wp_clone($data);
    375381
    376382                $this->cache[$group][$id] = $data;
Note: See TracChangeset for help on using the changeset viewer.