diff --git a/phpBB/adm/style/viewsource.html b/phpBB/adm/style/viewsource.html index 077a00b2b5..7f0fde239c 100644 --- a/phpBB/adm/style/viewsource.html +++ b/phpBB/adm/style/viewsource.html @@ -1,7 +1,7 @@
', '
','[', ']', '.', ':');
$str_to = array('', '', '', '[', ']', '.', ':');
$code = str_replace($str_from, $str_to, $code);
$code = preg_replace('#^()\n?(.*?)\n?()$#ism', '$1$2$3', $code);
-
+ $code = substr($code, strlen(''));
+ $code = substr($code, 0, -1 * strlen(' span>'));
$code = explode("\n", $code);
foreach ($code as $key => $line)
@@ -976,9 +976,14 @@ 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);
+
$filename = "{$cache_prefix}_$file.html.$phpEx";
-
$template->assign_block_vars('file', array(
'U_VIEWSOURCE' => $this->u_action . "&action=cache&id=$template_id&source=$file",
@@ -987,7 +992,7 @@ parse_css_file = {PARSE_CSS_FILE}
'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")),
'FILENAME' => $file,
'FILESIZE' => sprintf('%.1f KB', filesize("{$phpbb_root_path}cache/$filename") / 1024),
- 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . str_replace('.', '/', $file) . '.html') : $filemtime[$file . '.html']))
+ 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html") : $filemtime[$file . '.html']))
);
}
unset($filemtime);