[-] BO : Fix bug #PSCFV-8540 setting cookie key in cache key

This commit is contained in:
gRoussac committed 2013-04-05 17:59:46 +02:00
1 parent b101bdca71
commit f9de39b225
1 file changed
+5 -6
+5 -6
View File
@@ -205,7 +205,6 @@ abstract class CacheCore
foreach ($this->keys as $k => $ttl) foreach ($this->keys as $k => $ttl)
if (preg_match('#^'.$pattern.'$#', $k)) if (preg_match('#^'.$pattern.'$#', $k))
$keys[] = $k; $keys[] = $k;
} }
// Delete keys // Delete keys
@@ -235,13 +234,13 @@ abstract class CacheCore
if (is_null($this->sql_tables_cached)) if (is_null($this->sql_tables_cached))
{ {
$this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME); $this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME);
if (!is_array($this->sql_tables_cached)) if (!is_array($this->sql_tables_cached))
$this->sql_tables_cached = array(); $this->sql_tables_cached = array();
} }
// Store query results in cache if this query is not already cached // Store query results in cache if this query is not already cached
$key = md5($query); $key = md5(_COOKIE_IV_.$query);
if ($this->exists($key)) if ($this->exists($key))
return true; return true;
$this->set($key, $result); $this->set($key, $result);
@@ -251,7 +250,7 @@ abstract class CacheCore
foreach ($tables as $table) foreach ($tables as $table)
if (!isset($this->sql_tables_cached[$table][$key])) if (!isset($this->sql_tables_cached[$table][$key]))
$this->sql_tables_cached[$table][$key] = true; $this->sql_tables_cached[$table][$key] = true;
$this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached); $this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached);
} }
protected function getTables($string) protected function getTables($string)
@@ -271,7 +270,7 @@ abstract class CacheCore
{ {
if (is_null($this->sql_tables_cached)) if (is_null($this->sql_tables_cached))
{ {
$this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME); $this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME);
if (!is_array($this->sql_tables_cached)) if (!is_array($this->sql_tables_cached))
$this->sql_tables_cached = array(); $this->sql_tables_cached = array();
} }
@@ -287,7 +286,7 @@ abstract class CacheCore
} }
unset($this->sql_tables_cached[$table]); unset($this->sql_tables_cached[$table]);
} }
$this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached); $this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached);
} }
/** /**