aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/acp/acp_styles.php18
2 files changed, 10 insertions, 9 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 9fc81f337b..cf447ee7c6 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -110,6 +110,7 @@
<li>[Fix] Wrong message shown to user, when adding bots to friends/foes. (Bug #40205 - Patch by nickvergessen)</li>
<li>[Fix] Fix Oracle database backup (Bug #46715)</li>
<li>[Fix] Update attachments table when deleting user and retaining his posts. (Bug #40245 - Patch by rxu)</li>
+ <li>[Fix] Template cache error for files of template-subfolders (Bug #46145 - Patch by nickvergessen)</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 48802c79df..4c33aa1edb 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -1029,12 +1029,12 @@ parse_css_file = {PARSE_CSS_FILE}
foreach ($file_ary as $file)
{
- $file = str_replace('/', '.', $file);
+ $file = str_replace('/', '.', $file);
// perform some dirty guessing to get the path right.
// We assume that three dots in a row were '../'
- $tpl_file = str_replace('.', '/', $file);
- $tpl_file = str_replace('///', '../', $tpl_file);
+ $tpl_file = str_replace('.', '/', $file);
+ $tpl_file = str_replace('///', '../', $tpl_file);
$filename = "{$cache_prefix}_$file.html.$phpEx";
@@ -1066,6 +1066,11 @@ parse_css_file = {PARSE_CSS_FILE}
}
}
+ // Correct the filename if it is stored in database and the file is in a subfolder.
+ if ($template_row['template_storedb'])
+ {
+ $file = str_replace('.', '/', $file);
+ }
$template->assign_block_vars('file', array(
'U_VIEWSOURCE' => $this->u_action . "&amp;action=cache&amp;id=$template_id&amp;source=$file",
@@ -1073,7 +1078,7 @@ parse_css_file = {PARSE_CSS_FILE}
'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
'FILENAME' => $file,
'FILENAME_PATH' => $file_tpl,
- 'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024),
+ 'FILESIZE' => get_formatted_filesize(filesize("{$phpbb_root_path}cache/$filename")),
'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime($file_tpl) : $filemtime[$file . '.html']))
);
}
@@ -1271,7 +1276,6 @@ parse_css_file = {PARSE_CSS_FILE}
);
}
-
/**
* Edit imagesets
*
@@ -2409,7 +2413,6 @@ parse_css_file = {PARSE_CSS_FILE}
}
}
-
if ($mode == 'template')
{
$super = array();
@@ -3209,7 +3212,6 @@ parse_css_file = {PARSE_CSS_FILE}
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
if ($row)
{
// If it exist, we just use the style on installation
@@ -3260,7 +3262,6 @@ parse_css_file = {PARSE_CSS_FILE}
$inherit_bf = false;
}
-
if (sizeof($error))
{
return false;
@@ -3530,7 +3531,6 @@ parse_css_file = {PARSE_CSS_FILE}
break;
}
-
$sql = "SELECT {$mode}_inherits_id
FROM $sql_from
WHERE {$mode}_id = " . (int) $id;