minor #33016 [HttpKernel] Resilience against file_get_contents() race conditions (derrabus)

This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Resilience against file_get_contents() race conditions

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This PR addresses https://github.com/symfony/symfony/pull/33007#discussion_r311589966.

Commits
-------

5892837641 Resilience against file_get_contents() race conditions.
This commit is contained in:
Nicolas Grekas 2019-08-08 09:59:56 +02:00
commit ce09c31993
1 changed files with 1 additions and 1 deletions

View File

@ -356,7 +356,7 @@ class Store implements StoreInterface
{
$path = $this->getPath($key);
return file_exists($path) ? file_get_contents($path) : null;
return file_exists($path) && false !== ($contents = file_get_contents($path)) ? $contents : null;
}
/**