[HttpKernel] do is_file check before include

Trying to include a file that doesn't exist issues a warning. Doing an
is_file check beforehand should prevent those warnings.
This commit is contained in:
Bernd Stellwag 2021-03-19 08:57:35 +01:00
parent 5dd56a61a3
commit 8efcc17573
1 changed files with 1 additions and 1 deletions

View File

@ -533,7 +533,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
if (!flock($lock, $wouldBlock ? \LOCK_SH : \LOCK_EX)) {
fclose($lock);
$lock = null;
} elseif (!\is_object($this->container = include $cachePath)) {
} elseif (!is_file($cachePath) || !\is_object($this->container = include $cachePath)) {
$this->container = null;
} elseif (!$oldContainer || \get_class($this->container) !== $oldContainer->name) {
flock($lock, \LOCK_UN);