summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-04-19 06:56:52 +0000
committeralecpl <alec@alec.pl>2012-04-19 06:56:52 +0000
commit6a8b4c2951314441e670d89204dd3b913698b23d (patch)
tree6048896be31fb04bdba552fec9c0eb73841b2794
parentb4f95a9387a391054ad37c7cfc988ed66adc4b44 (diff)
- Fix incorrect cache ttl used in get_cache_engine() (#1488447), use time() where mktime() without arguments was used
-rw-r--r--program/include/rcmail.php2
-rw-r--r--program/include/rcube.php2
-rw-r--r--program/include/rcube_imap.php4
-rw-r--r--program/include/rcube_shared.inc2
4 files changed, 6 insertions, 4 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 024fd3ec3..e70980137 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -520,7 +520,7 @@ class rcmail extends rcube
$_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.php b/program/include/rcube.php
index 6064a7287..2566defa8 100644
--- a/program/include/rcube.php
+++ b/program/include/rcube.php
@@ -486,7 +486,7 @@ class rcube
public function temp_gc()
{
$tmp = unslashify($this->config->get('temp_dir'));
- $expire = mktime() - 172800; // expire in 48 hours
+ $expire = time() - 172800; // expire in 48 hours
if ($tmp && ($dir = opendir($tmp))) {
while (($fname = readdir($dir)) !== false) {
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 2e1e3ede5..daba72e50 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -3531,7 +3531,9 @@ class rcube_imap extends rcube_storage
{
if ($this->caching && !$this->cache) {
$rcube = rcube::get_instance();
- $ttl = $rcube->config->get('message_cache_lifetime', '10d') - mktime();
+ $ttl = $rcube->config->get('message_cache_lifetime', '10d');
+ $ttl = get_offset_time($ttl) - time();
+
$this->cache = $rcube->get_cache('IMAP', $this->caching, $ttl);
}
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc
index 30436b7bd..b3911659e 100644
--- a/program/include/rcube_shared.inc
+++ b/program/include/rcube_shared.inc
@@ -164,7 +164,7 @@ function get_offset_time($offset_str, $factor=1)
$unit = 's';
}
- $ts = mktime();
+ $ts = time();
switch ($unit) {
case 'w':
$amount *= 7;