aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/cache/driver/file.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-06-22 22:49:33 +0200
committerTristan Darricau <github@nicofuma.fr>2014-06-22 22:49:33 +0200
commitd039f56af00fb98b2b03f54f00ce4bb1436e9932 (patch)
treeede844c40fdf84f9c4c3be19004413418ac98b94 /phpBB/phpbb/cache/driver/file.php
parent50f4bea6101f64c513b3918ade58a712b00f3df7 (diff)
downloadforums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar.gz
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar.bz2
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.tar.xz
forums-d039f56af00fb98b2b03f54f00ce4bb1436e9932.zip
[ticket/12387] Use the hash as query_id for caching
PHPBB3-12387
Diffstat (limited to 'phpBB/phpbb/cache/driver/file.php')
-rw-r--r--phpBB/phpbb/cache/driver/file.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index b32af32d25..fbd3b571f7 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -396,13 +396,13 @@ class file extends \phpbb\cache\driver\base
{
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+ $query_id = md5($query);
- if (($rowset = $this->_read('sql_' . md5($query))) === false)
+ if (($rowset = $this->_read('sql_' . $query_id)) === false)
{
return false;
}
- $query_id = sizeof($this->sql_rowset);
$this->sql_rowset[$query_id] = $rowset;
$this->sql_row_pointer[$query_id] = 0;
@@ -417,7 +417,7 @@ class file extends \phpbb\cache\driver\base
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
- $query_id = sizeof($this->sql_rowset);
+ $query_id = md5($query);
$this->sql_rowset[$query_id] = array();
$this->sql_row_pointer[$query_id] = 0;
@@ -427,7 +427,7 @@ class file extends \phpbb\cache\driver\base
}
$db->sql_freeresult($query_result);
- if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query))
+ if ($this->_write('sql_' . $query_id, $this->sql_rowset[$query_id], $ttl + time(), $query))
{
return $query_id;
}