diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2009-06-16 16:13:53 +0000 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2009-06-16 16:13:53 +0000 |
commit | ef0eed4d9ef83d7dfbcdd1c78f812ef5e135f279 (patch) | |
tree | c53d0bda5689b3fb01f7e51759fd8cbdbc905958 /phpBB | |
parent | bfc8906a5ed4b99d0c592972b3267fe52d5da257 (diff) | |
download | forums-ef0eed4d9ef83d7dfbcdd1c78f812ef5e135f279.tar forums-ef0eed4d9ef83d7dfbcdd1c78f812ef5e135f279.tar.gz forums-ef0eed4d9ef83d7dfbcdd1c78f812ef5e135f279.tar.bz2 forums-ef0eed4d9ef83d7dfbcdd1c78f812ef5e135f279.tar.xz forums-ef0eed4d9ef83d7dfbcdd1c78f812ef5e135f279.zip |
Fix bug #46145 - Template cache error for files of template-subfolders
Authorised by: acydburn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9600 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 18 |
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 . "&action=cache&id=$template_id&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; |