1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 16:27:38 +02:00

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
This commit is contained in:
Andreas Fischer
2009-06-26 10:47:19 +00:00
parent fe916f427b
commit 5d6dca16a7
2 changed files with 15 additions and 1 deletions

View File

@@ -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)