#103177Inconsistent behavior in MathUtility::canBeInterpretedAsInteger() for boolean values
Description
The behavior of MathUtility::canBeInterpretedAsInteger() is inconsistent:
var_dump(MathUtility::canBeInterpretedAsInteger(true)); // true var_dump(MathUtility::canBeInterpretedAsInteger(false)); // false
Assuming that the common true = 1, false = 0 logic applies, the behavior should be fixed to accept both boolean values. Both can be coerced into integers and thus interpreted a such:
var_dump(MathUtility::canBeInterpretedAsInteger(true)); // true var_dump(MathUtility::canBeInterpretedAsInteger(false)); // true
Alternatively both boolean values should be rejected for consistency:
var_dump(MathUtility::canBeInterpretedAsInteger(true)); // false var_dump(MathUtility::canBeInterpretedAsInteger(false)); // false
Reviews 1
Related issues 1
History 25
-
Mathias Brodala changed Related to #103176 02/22/24, 11:53
-
Gerrit Code Review pushed patch set 1 for main to change 85332 status
NewUnder Review 07/23/24, 06:59 -
Gerrit Code Review pushed patch set 2 for main to change 85332 07/24/24, 07:03
-
Gerrit Code Review pushed patch set 3 for main to change 85332 07/24/24, 08:53
-
Stefan Bürk commented and changed status
Under ReviewRejected 10/23/25, 14:05
See comment from security team member @bfr https://review.typo3.org/c/Packages/TYPO3.CMS/+/85332/comments/465e0d52_49591f1a
Rejecting/Closing this now.