aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-06-26 10:47:19 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-06-26 10:47:19 +0000
commit5d6dca16a7b7e9c043570139c90b97c83a01bb5e (patch)
tree742eefdeef129313f6167d8a13b43ee3dc5ce3a3 /phpBB
parentfe916f427b54d11ff9c87256f7ea05ccbe3e74c6 (diff)
downloadforums-5d6dca16a7b7e9c043570139c90b97c83a01bb5e.tar
forums-5d6dca16a7b7e9c043570139c90b97c83a01bb5e.tar.gz
forums-5d6dca16a7b7e9c043570139c90b97c83a01bb5e.tar.bz2
forums-5d6dca16a7b7e9c043570139c90b97c83a01bb5e.tar.xz
forums-5d6dca16a7b7e9c043570139c90b97c83a01bb5e.zip
Fix bug #47345 - Check if template file is empty before trying to read from it.
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9682 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/acp/acp_styles.php15
2 files changed, 15 insertions, 1 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index ba2c94e851..2567ba288e 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -137,6 +137,7 @@
<li>[Fix] Add poster-name to moderator-log when deleting post/topic (Bug #46225 - Patch by nickvergessen)</li>
<li>[Fix] &quot;Report details&quot; link broken in MCP (Bug #46975 - Patch by nickvergessen)</li>
<li>[Fix] Resolve accesskey conflicts in prosilver. (Bug #44685 - Patch by bantu)</li>
+ <li>[Fix] Check if template file is empty before trying to read from it. (Bug #47345 - Patch by bantu)</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
<li>[Change] Template engine now permits to a limited extent variable includes.</li>
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 16b1852cd6..ab9ddc0b6f 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -2556,9 +2556,22 @@ parse_css_file = {PARSE_CSS_FILE}
{
trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
}
- $template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"));
+
+ $filesize = filesize("{$phpbb_root_path}styles/$template_path$pathfile$file");
+
+ if ($filesize)
+ {
+ $template_data = fread($fp, $filesize);
+ }
+
fclose($fp);
+ if (!$filesize)
+ {
+ // File is empty
+ continue;
+ }
+
if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
{
foreach ($matches[1] as $match)