[!!!][BUGFIX] Cast negative int to boolean (true) in BooleanNode
Currently Fluid treats negative integers as false which results in <f:if condition="-9"> rendering else instead of then. When casting integers to boolean using php all integers other than 0 (zero) are casted to true, just 0 results in false. Therefore, casting of BooleanNode::convertToBoolean must be adjusted to act like plain php. This bugfix is a breaking change as people might have deliberately used the wrong behaviour. Releases: 6.2 Resolves: #54243 Resolves: #33597 Change-Id: Iebaa578cf071909610ca0e1abfc9bfaad7459231 Reviewed-on: https://review.typo3.org/26784 Reviewed-by: Oliver Hader Tested-by: Oliver Hader Reviewed-by: Stefan Neufeind Reviewed-by: Nicole Cordes Tested-by: Nicole Cordes
Showing
- typo3/sysext/fluid/Classes/Core/Parser/SyntaxTree/BooleanNode.php 9 additions, 2 deletions...sext/fluid/Classes/Core/Parser/SyntaxTree/BooleanNode.php
- typo3/sysext/fluid/Tests/Unit/Core/Parser/SyntaxTree/BooleanNodeTest.php 31 additions, 3 deletions...uid/Tests/Unit/Core/Parser/SyntaxTree/BooleanNodeTest.php
Please register or sign in to comment