Skip to content

Commit bd2e795

Browse files
[Cache] Fix incorrect timestamps generated by FilesystemAdapter
1 parent 54043a0 commit bd2e795

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Cache/Adapter/FilesystemAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected function doDelete(array $ids)
126126
protected function doSave(array $values, $lifetime)
127127
{
128128
$ok = true;
129-
$expiresAt = $lifetime ? time() + $lifetime : PHP_INT_MAX;
129+
$expiresAt = time() + ($lifetime ?: 31557600); // 31557600s = 1 year
130130
$tmp = $this->directory.uniqid('', true);
131131

132132
foreach ($values as $id => $value) {

0 commit comments

Comments
 (0)