Issue Bug Closed

#87978Missing declarations in MathExpressionNode.php

Daxboeck no-lastname-given 03/22/19, 07:51 updated 08/22/19, 18:33

Description

Dear Ladies and Gentlemen,

unfortunately someone closed #85604 and #85741 without implementing the reported fix which is quite a pity !

As the issue was reported more than 6 months ago in 8LTS and still persists in current 9LTS, I kindly ask you to fix MathExpressionNode.php for all these TYPO3 versions:

—- MathExpressionNode.php-2019-03-22-dax 2019-03-22 07:43:16.926881483 +0100
+++ MathExpressionNode.php 2019-03-22 07:44:46.027915978 +0100
@@ -70,17 +70,17
protected static function evaluateOperation($left, $operator, $right) {
if ($operator = '%') {
- return $left % $right;
+ return (float)$left % (float)$right;
} elseif ($operator = ‘‘) {
return $left – $right;
+ return (float)$left – (float)$right;
} elseif ($operator = '+') {
- return $left + $right;
+ return (float)$left + (float)$right;
} elseif ($operator = ‘*’) {
- return $left * $right;
+ return (float)$left * (float)$right;
} elseif ($operator = '/') {
- return (integer) $right ! 0 ? $left / $right : 0;
+ return (integer) (float)$right !== 0 ? (float)$left / (float)$right : 0;
} elseif ($operator === ‘^’) {
- return pow($left, $right);
+ return pow((float)$left, (float)$right);
}
return 0;
}

So, please before you close this issue, make sure this patch is actually being included in 8LTS and 9TLS as this is really a no-brainer.

Best regards,

Patrick

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.