From 2797867ae95f6c532960078b38315ba59bc2c21f Mon Sep 17 00:00:00 2001 From: Arman Hosseini Date: Thu, 2 Jan 2020 00:53:08 +0330 Subject: [PATCH] Check non-null type for numeric type $maxAge and $sharedAge can both be zero --- .../FrameworkBundle/Controller/TemplateController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php index f72d556f60b5..52086ef8dd22 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php @@ -75,17 +75,17 @@ public function templateAction($template, $maxAge = null, $sharedAge = null, $pr throw new \LogicException('You can not use the TemplateController if the Templating Component or the Twig Bundle are not available.'); } - if ($maxAge) { + if (null !== $maxAge) { $response->setMaxAge($maxAge); } - if ($sharedAge) { + if (null !== $sharedAge) { $response->setSharedMaxAge($sharedAge); } if ($private) { $response->setPrivate(); - } elseif (false === $private || (null === $private && ($maxAge || $sharedAge))) { + } elseif (false === $private || (null === $private && (null !== $maxAge || null !== $sharedAge))) { $response->setPublic(); }