aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/style.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-08-15 17:32:48 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-08-15 17:32:48 +0000
commit2bbd2fb1f97d4668e82c26badbe89c3d3fdc8169 (patch)
tree3dbeba19d89b737a07cf7cc23b8c4693d35234ea /phpBB/style.php
parent3ada3b76f0ce86274647758db029d84a0f404886 (diff)
downloadforums-2bbd2fb1f97d4668e82c26badbe89c3d3fdc8169.tar
forums-2bbd2fb1f97d4668e82c26badbe89c3d3fdc8169.tar.gz
forums-2bbd2fb1f97d4668e82c26badbe89c3d3fdc8169.tar.bz2
forums-2bbd2fb1f97d4668e82c26badbe89c3d3fdc8169.tar.xz
forums-2bbd2fb1f97d4668e82c26badbe89c3d3fdc8169.zip
some bugs fixed
git-svn-id: file:///svn/phpbb/trunk@8033 89ea8834-ac86-4346-8a33-228a782c2dd0
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');