From f0a96ebc1e4386dc7115ecaf456ed52e82b56fa7 Mon Sep 17 00:00:00 2001 From: Stricted Date: Wed, 12 Mar 2014 16:42:09 +0100 Subject: [PATCH] update getTTL method --- .../cache/source/MemcachedCacheSource.class.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php index 79bd60383c..8217336fd7 100644 --- a/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php @@ -224,17 +224,8 @@ class MemcachedCacheSource implements ICacheSource { * @return integer */ protected function getTTL($maxLifetime = 0) { - if ($maxLifetime) { - // max lifetime is a timestamp -> http://www.php.net/manual/en/memcached.expiration.php - if ($maxLifetime > (60 * 60 * 24 * 30)) { - // timestamp is in the past, discard - if ($maxLifetime < TIME_NOW) { - $maxLifetime = 0; - } - } - } - - if ($maxLifetime) { + // max lifetime is a timestamp -> http://www.php.net/manual/en/memcached.expiration.php + if ($maxLifetime && ($maxLifetime <= (60 * 60 * 24 * 30) || $maxLifetime >= TIME_NOW)) { return $maxLifetime; } -- 2.20.1