bug #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 | #19431
| License       | MIT
| Doc PR        | -

Commits
-------

bd2e795 [Cache] Fix incorrect timestamps generated by FilesystemAdapter
This commit is contained in:
Nicolas Grekas 2016-07-27 16:06:17 +02:00
commit 26dfa2f879

View File

@ -126,7 +126,7 @@ class FilesystemAdapter extends AbstractAdapter
protected function doSave(array $values, $lifetime)
{
$ok = true;
$expiresAt = $lifetime ? time() + $lifetime : PHP_INT_MAX;
$expiresAt = time() + ($lifetime ?: 31557600); // 31557600s = 1 year
$tmp = $this->directory.uniqid('', true);
foreach ($values as $id => $value) {