Skip to content

Commit d67b83c

Browse files
Merge branch '3.4' into 4.3
* 3.4: [Yaml] Implement multiline string as scalar block for tagged values [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given [FrameworkBundle] Use UserInterface to @return in getUser method [CI] Replace php7.4snapshot with php7.4 in Travis configuration [ExpressionLanguage][Node][BinaryNode] Process division by zero forward caught exception [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime add tags before processing them [MonologBridge] Fix debug processor datetime type
2 parents d81f0eb + 3a4cff8 commit d67b83c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Node/BinaryNode.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,16 @@ public function evaluate($functions, $values)
147147
case '*':
148148
return $left * $right;
149149
case '/':
150+
if (0 == $right) {
151+
throw new \DivisionByZeroError('Division by zero');
152+
}
153+
150154
return $left / $right;
151155
case '%':
156+
if (0 == $right) {
157+
throw new \DivisionByZeroError('Modulo by zero');
158+
}
159+
152160
return $left % $right;
153161
case 'matches':
154162
return preg_match($right, $left);

0 commit comments

Comments
 (0)