aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acm
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acm')
-rw-r--r--phpBB/includes/acm/acm_file.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index 856170497e..883878b4b4 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -170,6 +170,9 @@ class acm
{
global $db, $phpEx;
+ // Remove extra spaces and tabs
+ $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+
$filemtime = intval(@filemtime($this->cache_dir . md5($query) . '.' . $phpEx));
if (time() - $filemtime > $expire_time)
{
@@ -187,6 +190,10 @@ class acm
function sql_save($query, $result)
{
global $db, $phpEx;
+
+ // Remove extra spaces and tabs
+ $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+
if ($fp = @fopen($this->cache_dir . md5($query) . '.' . $phpEx, 'wb'))
{
@flock($fp, LOCK_EX);