[BUGFIX] CF FileBackend unlimited lifetime support 83/24083/2
authorDominique Feyer <dfeyer@ttree.ch>
Thu, 26 Sep 2013 15:41:49 +0000 (17:41 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 26 Sep 2013 19:50:29 +0000 (21:50 +0200)
Backport of a bugfix that was part of #39430 in 6.0.

Change-Id: I2266ae12284a139a384854e3ff0bacf23f277859
Resolves: #34886
Related: #39430
Releases: 4.7, 4.5
Reviewed-on: https://review.typo3.org/24073
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
(cherry picked from commit e06f05a67c6c516f5970ce4d5785f8c9356e34ff)
Reviewed-on: https://review.typo3.org/24083

t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php

index 46dce31..3a5df5a 100644 (file)
@@ -243,7 +243,8 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
                        );
                }
 
-               $expiryTime = ($lifetime === NULL) ? 0 : ($GLOBALS['EXEC_TIME'] + $lifetime);
+               $lifetime = $lifetime === NULL ? $this->defaultLifetime : $lifetime;
+               $expiryTime = ($lifetime === 0) ? 0 : ($GLOBALS['EXEC_TIME'] + $lifetime);
                $metaData = str_pad($expiryTime, self::EXPIRYTIME_LENGTH) . implode(' ', $tags) . str_pad(strlen($data), self::DATASIZE_DIGITS);
                $result = file_put_contents($temporaryCacheEntryPathAndFilename, $data . $metaData);
                t3lib_div::fixPermissions($temporaryCacheEntryPathAndFilename);
@@ -547,4 +548,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php']);
 }
 
-?>
\ No newline at end of file
+?>