mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 17:01:07 +02:00
implement change style check suggested by code reader.
git-svn-id: file:///svn/phpbb/trunk@7500 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@ -115,12 +115,37 @@ if ($id && $sid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Re-cache stylesheet data if necessary
|
// Re-cache stylesheet data if necessary
|
||||||
if ($config['load_tplcompile'] && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
|
if ($config['load_tplcompile'])
|
||||||
|
{
|
||||||
|
$recache = false;
|
||||||
|
$update_time = time();
|
||||||
|
|
||||||
|
// We test for stylesheet.css because it is faster and most likely the only file changed on common themes
|
||||||
|
if ($theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
|
||||||
|
{
|
||||||
|
$recache = true;
|
||||||
|
$update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$last_change = $theme['theme_mtime'];
|
||||||
|
|
||||||
|
foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file)
|
||||||
|
{
|
||||||
|
if ($last_change < @filemtime($file))
|
||||||
|
{
|
||||||
|
$recache = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($recache)
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
|
include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
|
||||||
|
|
||||||
$theme['theme_data'] = acp_styles::db_theme_data($theme);
|
$theme['theme_data'] = acp_styles::db_theme_data($theme);
|
||||||
$theme['theme_mtime'] = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
|
$theme['theme_mtime'] = $update_time;
|
||||||
|
|
||||||
// Save CSS contents
|
// Save CSS contents
|
||||||
$sql_ary = array(
|
$sql_ary = array(
|
||||||
@ -136,6 +161,7 @@ if ($id && $sid)
|
|||||||
|
|
||||||
header('Expires: 0');
|
header('Expires: 0');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
|
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
|
||||||
|
Reference in New Issue
Block a user