WordPress.org

Make WordPress Core

Ticket #3726: kill_references_when_caching_objects.diff

File kill_references_when_caching_objects.diff, 826 bytes (added by markjaquith, 11 years ago)
  • wp-includes/cache.php

     
    11<?php
    22function wp_cache_add($key, $data, $flag = '', $expire = 0) {
    33        global $wp_object_cache;
     4        $data = unserialize(serialize($data));
    45
    56        return $wp_object_cache->add($key, $data, $flag, $expire);
    67}
     
    3738
    3839function wp_cache_replace($key, $data, $flag = '', $expire = 0) {
    3940        global $wp_object_cache;
     41        $data = unserialize(serialize($data));
    4042
    4143        return $wp_object_cache->replace($key, $data, $flag, $expire);
    4244}
    4345
    4446function wp_cache_set($key, $data, $flag = '', $expire = 0) {
    4547        global $wp_object_cache;
     48        $data = unserialize(serialize($data));
    4649
    4750        return $wp_object_cache->set($key, $data, $flag, $expire);
    4851}