aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_styles.php
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/includes/acp/acp_styles.php
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/includes/acp/acp_styles.php')
-rw-r--r--phpBB/includes/acp/acp_styles.php15
1 files changed, 14 insertions, 1 deletions
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)