From 18cb8d721c0b645b33ca3c09dbbfd4267eebba35 Mon Sep 17 00:00:00 2001 From: Will Morgan Date: Thu, 17 Oct 2013 17:36:07 +0100 Subject: [PATCH] Making cacheToFile key more resilient against mixed/nested types --- core/Object.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Object.php b/core/Object.php index 3c5480a47..ba72a2b51 100755 --- a/core/Object.php +++ b/core/Object.php @@ -1066,7 +1066,7 @@ abstract class Object { if(!is_array($arguments)) $arguments = array($arguments); if($ID) $cacheName .= '_' . $ID; - if(count($arguments)) $cacheName .= '_' . implode('_', $arguments); + if(count($arguments)) $cacheName .= '_' . md5(serialize($arguments)); if($data = $this->loadCache($cacheName, $lifetime)) { return $data; @@ -1085,7 +1085,7 @@ abstract class Object { $cacheName = $this->class . '_' . $method; if(!is_array($arguments)) $arguments = array($arguments); if($ID) $cacheName .= '_' . $ID; - if(count($arguments)) $cacheName .= '_' . implode('_', $arguments); + if(count($arguments)) $cacheName .= '_' . md5(serialize($arguments)); $file = TEMP_FOLDER . '/' . $this->sanitiseCachename($cacheName); if(file_exists($file)) unlink($file);