From d9468c35da7df11ff12b0575b69ff97719cc3480 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 11 Mar 2009 12:53:54 +0000 Subject: [PATCH] add IN_PHPBB check to generated cache files git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9363 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 3 ++- phpBB/includes/acm/acm_file.php | 6 +++--- phpBB/includes/functions_messenger.php | 4 ++-- phpBB/includes/functions_template.php | 8 ++++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 20107e1fae..7854ba88d5 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -105,7 +105,7 @@
  • [Fix] Log password changes via password reset function. (Bug #41365)
  • [Fix] Poll, negative durations generate error (Bug #41295 - Patch by TerraFrost)
  • [Fix] Visibility of custom field on registration is incorrectly controlled by setting "display" (Bug #41385 - Patch by Eelke)
  • -
  • [Fix] Smile in Username is misparsed on [quote=""] (Bug #41955 - Patch by TerraFrost)
  • +
  • [Fix] Smile in Username is misparsed on [quote=""] (Bug #41955 - Patch by TerraFrost)
  • [Fix] Deleting all posts in a topic - bad redirect (Bug #41705 - Patch by TerraFrost)
  • [Fix] Deleted users still appear logged in (Bug #41985 - Patch by TerraFrost)
  • [Fix] Removed redundant code and unnecessary queries in forum management. (Bug #42265 - Patch by nickvergessen)
  • @@ -118,6 +118,7 @@
  • [Change] Added new option for merging differences to conflicting files in automatic updater
  • [Change] Added new options for visual confirmation.
  • [Change] Add link to user profile in the MCP for user notes and warn user.
  • +
  • [Change] Add IN_PHPBB check to generated cache files. (reported by bantu)
  • [Feature] Allow translation of custom BBCode help messages. (Patch by bantu)
  • [Feature] db_tools now support create table and drop table.
  • [Feature] Database updater checks for incompatible db schema (MySQL 3.x/4.x against MySQL 4.1.x/5.x/6.x)
  • diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 22c7ba8bda..f9ff92e19d 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -89,7 +89,7 @@ class acm if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, "vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>"); + fwrite($fp, "vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>"); @flock($fp, LOCK_UN); fclose($fp); @@ -202,7 +202,7 @@ class acm if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>"); + fwrite($fp, " " . (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 } $db->sql_freeresult($query_result); - $file = " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\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?>"); diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 17c59e5274..ba38d6d0f1 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -704,7 +704,7 @@ class queue if ($fp = @fopen($this->cache_file, 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, "queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>"); + fwrite($fp, "queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); @@ -745,7 +745,7 @@ class queue if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, "queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>"); + fwrite($fp, "queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 9f137d9151..925630e7ec 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -223,9 +223,13 @@ class template_compile // There will be a number of occasions where we switch into and out of // PHP mode instantaneously. Rather than "burden" the parser with this // we'll strip out such occurences, minimising such switching - $template_php = str_replace(' ?>" . $template_php; + return str_replace(' ?>