Actions
Bug #85741
closedBugfix for MathExpressionNode.php
Start date:
2018-08-03
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
/** * @param integer|float $left * @param string $operator * @param integer|float $right * @return integer|float */ protected static function evaluateOperation($left, $operator, $right) { if ($operator === '%') { return (float)$left % (float)$right; } elseif ($operator === '-') { return (float)$left - (float)$right; } elseif ($operator === '+') { return (float)$left + (float)$right; } elseif ($operator === '*') { return (float)$left * (float)$right; } elseif ($operator === '/') { return (integer) $right !== 0 ? (float)$left / (float)$right : 0; } elseif ($operator === '^') { return pow((float)$left, (float)$right); } return 0; }
Updated by Georg Ringer over 6 years ago
- Description updated (diff)
- Status changed from New to Needs Feedback
please add some more information: how to reproduce? what do you expect, what is the current outcome?
Updated by Daxboeck no-lastname-given over 6 years ago
I had to add the type declarations (float) to avoid warnings when I used Math in my Fluid templates.
e.g. {dimensions.height*1.5} did cause a PHP warning in that file (MathExpressionNode.php), which the above code replacement fixes.
Updated by Susanne Moog about 6 years ago
- Target version changed from 8.7.19 to Candidate for patchlevel
Updated by Wouter Wolters about 6 years ago
- Is duplicate of Bug #85604: PHP warning when doing math in Fluid added
Updated by Wouter Wolters about 6 years ago
- Status changed from Needs Feedback to Closed
Closing this ticket as duplicate of #85604
Updated by Oliver Hader over 5 years ago
- Has duplicate Bug #87978: Missing declarations in MathExpressionNode.php added
Actions