mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-08 08:35:31 +02:00
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
This commit is contained in:
parent
bfc8906a5e
commit
ef0eed4d9e
@ -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>
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user