From 944a2c938f3b3cf7b38c47ad6764e46420a58cab Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Sun, 6 Jan 2008 22:46:20 +0000 Subject: [PATCH] dmllib:rcache_get()/rcache_set() clone cached records - we do not want magic references here - MDL-12827\n And calling fullclone() with the huge cost in serialize()/unserialize() is not needed. --- lib/dmllib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dmllib.php b/lib/dmllib.php index 14a344e70a..47a5043032 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -2583,7 +2583,7 @@ function rcache_set($table, $id, $rec) { global $CFG, $MCACHE, $rcache; if ($CFG->cachetype === 'internal') { - $rcache->data[$table][$id] = fullclone($rec); + $rcache->data[$table][$id] = clone $rec; } else { $key = $table . '|' . $id; @@ -2647,7 +2647,7 @@ function rcache_get($table, $id) { if ($CFG->cachetype === 'internal') { if (isset($rcache->data[$table][$id])) { $rcache->hits++; - return $rcache->data[$table][$id]; + return clone $rcache->data[$table][$id]; } else { $rcache->misses++; return false; -- 2.39.5