Skip to content

Commit 26dfa2f

Browse files
bug symfony#19435 [Cache] Fix incorrect timestamps generated by FilesystemAdapter (nicolas-grekas)
This PR was merged into the 3.1 branch. Discussion ---------- [Cache] Fix incorrect timestamps generated by FilesystemAdapter | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#19431 | License | MIT | Doc PR | - Commits ------- bd2e795 [Cache] Fix incorrect timestamps generated by FilesystemAdapter
2 parents 3a57de1 + bd2e795 commit 26dfa2f

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)