From 6dc7ce5a0692bf7433a5ab2221457fda4893502a Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 19 Apr 2012 07:02:14 +0000 Subject: - Fix incorrect cache ttl used in get_cache_engine() (#1488447) --- program/include/rcmail.php | 2 +- program/include/rcube_imap.php | 3 ++- program/include/rcube_shared.inc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/program/include/rcmail.php b/program/include/rcmail.php index a86729156..eec3dd27f 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -966,7 +966,7 @@ class rcmail $_SESSION['storage_port'] = $port; $_SESSION['storage_ssl'] = $ssl; $_SESSION['password'] = $this->encrypt($pass); - $_SESSION['login_time'] = mktime(); + $_SESSION['login_time'] = time(); if (isset($_REQUEST['_timezone']) && $_REQUEST['_timezone'] != '_default_') $_SESSION['timezone'] = floatval($_REQUEST['_timezone']); diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index bd8f35176..5e36f16c5 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -3531,7 +3531,8 @@ class rcube_imap extends rcube_storage { if ($this->caching && !$this->cache) { $rcmail = rcmail::get_instance(); - $ttl = $rcmail->config->get('message_cache_lifetime', '10d') - mktime(); + $ttl = $rcmail->config->get('message_cache_lifetime', '10d'); + $ttl = get_offset_time($ttl) - time(); $this->cache = $rcmail->get_cache('IMAP', $this->caching, $ttl); } diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index 9340091bb..ab4b77bae 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -66,7 +66,7 @@ function send_future_expire_header($offset=2600000) if (headers_sent()) return; - header("Expires: ".gmdate("D, d M Y H:i:s", mktime()+$offset)." GMT"); + header("Expires: ".gmdate("D, d M Y H:i:s", time()+$offset)." GMT"); header("Cache-Control: max-age=$offset"); header("Pragma: "); } @@ -299,7 +299,7 @@ function get_offset_time($offset_str, $factor=1) $unit = 's'; } - $ts = mktime(); + $ts = time(); switch ($unit) { case 'w': -- cgit v1.2.3