diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-19 07:42:19 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-19 07:42:19 +0000 |
| commit | 392903aed8e7889b867e89669095ad473f9fb5bb (patch) | |
| tree | 472a1a9e11999bb9bbf47163d0f37a077c37c8c8 /roundcubemail/program/include/rcube_cache.php | |
| parent | 2c79c401f0c4fc90ecd9fc06ae1eb5dbf8a3dca2 (diff) | |
- Improved ttl values handling
git-svn-id: https://svn.roundcube.net/trunk@6103 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_cache.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_cache.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_cache.php b/roundcubemail/program/include/rcube_cache.php index 6d7a9eacd..ef04beba5 100644 --- a/roundcubemail/program/include/rcube_cache.php +++ b/roundcubemail/program/include/rcube_cache.php @@ -59,7 +59,7 @@ class rcube_cache * @param string $type Engine type ('db' or 'memcache' or 'apc') * @param int $userid User identifier * @param string $prefix Key name prefix - * @param int $ttl Expiration time of memcache/apc items in seconds (max.2592000) + * @param string $ttl Expiration time of memcache/apc items * @param bool $packed Enables/disabled data serialization. * It's possible to disable data serialization if you're sure * stored data will be always a safe string @@ -82,8 +82,12 @@ class rcube_cache $this->db = $rcube->get_dbh(); } + // convert ttl string to seconds + $ttl = get_offset_sec($ttl); + if ($ttl > 2592000) $ttl = 2592000; + $this->userid = (int) $userid; - $this->ttl = (int) $ttl; + $this->ttl = $ttl; $this->packed = $packed; $this->prefix = $prefix; } |
