Project

General

Profile

Actions

Bug #87978

closed

Missing declarations in MathExpressionNode.php

Added by Daxboeck no-lastname-given about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2019-03-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
8LTS, 9LTS missing declarations
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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


Related issues 2 (0 open2 closed)

Is duplicate of TYPO3 Core - Bug #85604: PHP warning when doing math in FluidClosed2018-07-20

Actions
Is duplicate of TYPO3 Core - Bug #85741: Bugfix for MathExpressionNode.phpClosed2018-08-03

Actions
Actions

Also available in: Atom PDF