From: Stricted Date: Wed, 12 Mar 2014 15:42:09 +0000 (+0100) Subject: update getTTL method X-Git-Tag: 2.0.4~19^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f0a96ebc1e4386dc7115ecaf456ed52e82b56fa7;p=GitHub%2FWoltLab%2FWCF.git update getTTL method --- 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; }