Skip to content

Commit af491fc

Browse files
committed
make sure nothing going into the object cache is being passed by reference. fixes WordPress#3726
git-svn-id: https://develop.svn.wordpress.org/branches/2.1@4857 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 38a6a76 commit af491fc

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

wp-includes/cache.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
function 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
}
@@ -37,12 +38,14 @@ function wp_cache_init() {
3738

3839
function 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

4446
function 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
}

wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
// This holds the version number in a separate file so we can bump it without cluttering the SVN
44

55
$wp_version = '2.1.1-alpha';
6-
$wp_db_version = 4772;
6+
$wp_db_version = 4773;
77

88
?>

0 commit comments

Comments
 (0)