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:
commit
ce09c31993
@ -356,7 +356,7 @@ class Store implements StoreInterface
|
|||||||
{
|
{
|
||||||
$path = $this->getPath($key);
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user