diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-11-22 19:06:42 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-11-22 19:06:42 +0000 |
commit | f588f58fa9e5a08fef4f480e17ae25f4f7e94071 (patch) | |
tree | 5b67cef14eb0d43ce0137d5538283efaf72045ae /phpBB/includes | |
parent | 127750f89d114b7ab9a2e9442c7b3bd28084c5df (diff) | |
download | forums-f588f58fa9e5a08fef4f480e17ae25f4f7e94071.tar forums-f588f58fa9e5a08fef4f480e17ae25f4f7e94071.tar.gz forums-f588f58fa9e5a08fef4f480e17ae25f4f7e94071.tar.bz2 forums-f588f58fa9e5a08fef4f480e17ae25f4f7e94071.tar.xz forums-f588f58fa9e5a08fef4f480e17ae25f4f7e94071.zip |
small adjustement... only add an empty array if cached data is empty (from 3.2.x)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9076 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acm/acm_file.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index ece2a96779..f58f925506 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -199,7 +199,7 @@ class acm if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = unserialize(" . var_export(serialize($var), true) . ");\n\n?>"); + fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); @@ -424,7 +424,7 @@ class acm $file = "<?php\n\n/* " . str_replace('*/', '*\/', $query) . " */\n"; $file .= "\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n"; - fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");\n\n?>"); + fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . (sizeof($this->sql_rowset[$query_id]) ? "unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");" : 'array();') . "\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); |