From 318b9eb048fc55a19b6f6830bcac78214ef9ab7a Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 5 Dec 2019 16:46:32 +0300 Subject: [PATCH] [ExpressionLanguage][Node][BinaryNode] Process division by zero --- src/Symfony/Component/ExpressionLanguage/Node/BinaryNode.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/ExpressionLanguage/Node/BinaryNode.php b/src/Symfony/Component/ExpressionLanguage/Node/BinaryNode.php index 0af4f16623e0c..e27b099eb339a 100644 --- a/src/Symfony/Component/ExpressionLanguage/Node/BinaryNode.php +++ b/src/Symfony/Component/ExpressionLanguage/Node/BinaryNode.php @@ -147,6 +147,10 @@ public function evaluate($functions, $values) case '*': return $left * $right; case '/': + if (0 == $right) { + throw new \DivisionByZeroError('Division by zero'); + } + return $left / $right; case '%': return $left % $right; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy