aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/style.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/style.php')
-rw-r--r--phpBB/style.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/phpBB/style.php b/phpBB/style.php
index b33d473ae7..0ce5460dac 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -46,7 +46,7 @@ if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
// happen to have a current session it will output nothing. We will also cache the
// resulting CSS data for five minutes ... anything to reduce the load on the SQL
// server a little
-if ($id && $sid)
+if ($id)
{
if (empty($acm_type) || empty($dbms))
{
@@ -101,6 +101,11 @@ if ($id && $sid)
$theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+ if (!$theme)
+ {
+ exit;
+ }
+
if ($user['user_id'] == ANONYMOUS)
{
$user['user_lang'] = $config['default_lang'];
@@ -115,16 +120,11 @@ if ($id && $sid)
$result = $db->sql_query($sql, 3600);
$img_array = array();
-
while ($row = $db->sql_fetchrow($result))
{
$img_array[$row['image_name']] = $row;
}
-
- if (!$theme)
- {
- exit;
- }
+ $db->sql_freeresult($result);
// gzip_compression
if ($config['gzip_compress'])
@@ -191,7 +191,11 @@ if ($id && $sid)
$db->sql_query($sql);
$cache->destroy('sql', STYLES_THEME_TABLE);
+ }
+ // Only set the expire time if the theme changed data is older than 30 minutes - to cope with changes from the ACP
+ if ($recache || $theme['theme_mtime'] > (time() - 1800))
+ {
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
header('Pragma: no-cache');