mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Use phpBB 3.1.x method for storing cached data to prevent PHP bug with our usage of var_export(). (Thanks to Techie Micheal and HoL for pointing out possible problems)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8955 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
0a98003d91
commit
1f01089e2f
3 changed files with 5 additions and 4 deletions
|
@ -127,6 +127,7 @@
|
||||||
<li>[Fix] Fix problems with styles using an underscore within the filename. (Bug #34315)</li>
|
<li>[Fix] Fix problems with styles using an underscore within the filename. (Bug #34315)</li>
|
||||||
<li>[Fix] Better return links when deleting topics through the MCP. (Bug #34655)</li>
|
<li>[Fix] Better return links when deleting topics through the MCP. (Bug #34655)</li>
|
||||||
<li>[Fix] Add quoting support to PM history when composing a reply. (Bug #34285)</li>
|
<li>[Fix] Add quoting support to PM history when composing a reply. (Bug #34285)</li>
|
||||||
|
<li>[Fix] Use phpBB 3.1.x method for storing cached data to prevent PHP bug with our usage of var_export(). (Thanks to Techie Micheal and HoL for pointing out possible problems)</li>
|
||||||
|
|
||||||
<li>[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.</li>
|
<li>[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.</li>
|
||||||
<li>[Change] Display warning in ACP if config.php file is left writable.</li>
|
<li>[Change] Display warning in ACP if config.php file is left writable.</li>
|
||||||
|
|
|
@ -193,7 +193,7 @@ class acm
|
||||||
if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
|
if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
|
||||||
{
|
{
|
||||||
@flock($fp, LOCK_EX);
|
@flock($fp, LOCK_EX);
|
||||||
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . var_export($var, true) . ";\n?>");
|
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = unserialize(" . var_export(serialize($var), true) . ");\n\n?>");
|
||||||
@flock($fp, LOCK_UN);
|
@flock($fp, LOCK_UN);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ class acm
|
||||||
$file = "<?php\n\n/* " . str_replace('*/', '*\/', $query) . " */\n";
|
$file = "<?php\n\n/* " . str_replace('*/', '*\/', $query) . " */\n";
|
||||||
$file .= "\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n";
|
$file .= "\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n";
|
||||||
|
|
||||||
fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . var_export($this->sql_rowset[$query_id], true) . ";\n?>");
|
fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");\n\n?>");
|
||||||
@flock($fp, LOCK_UN);
|
@flock($fp, LOCK_UN);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
|
|
@ -693,7 +693,7 @@ class queue
|
||||||
if ($fp = @fopen($this->cache_file, 'w'))
|
if ($fp = @fopen($this->cache_file, 'w'))
|
||||||
{
|
{
|
||||||
@flock($fp, LOCK_EX);
|
@flock($fp, LOCK_EX);
|
||||||
fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->queue_data, true) . ";\n?>");
|
fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
|
||||||
@flock($fp, LOCK_UN);
|
@flock($fp, LOCK_UN);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ class queue
|
||||||
if ($fp = @fopen($this->cache_file, 'w'))
|
if ($fp = @fopen($this->cache_file, 'w'))
|
||||||
{
|
{
|
||||||
@flock($fp, LOCK_EX);
|
@flock($fp, LOCK_EX);
|
||||||
fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->data, true) . ";\n?>");
|
fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
|
||||||
@flock($fp, LOCK_UN);
|
@flock($fp, LOCK_UN);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue