update getTTL method
authorStricted <info@stricted.de>
Wed, 12 Mar 2014 15:42:09 +0000 (16:42 +0100)
committerStricted <info@stricted.de>
Wed, 12 Mar 2014 15:42:09 +0000 (16:42 +0100)
wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php

index 79bd60383cecfd4a949b5ab7391cda3756daf579..8217336fd71eb736169c103290795a0d8374bbde 100644 (file)
@@ -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;
                }