IsNumeric returns True on strings like "3d" and "6f" (5.3.8 regression!)
The change done for tickets and LDEV-2353, which is already deployed as a RC in 184.108.40.206, introduces a new bug for `isNumeric()`.
When the string to test ends with a “d” or an “f” (a java type qualifier for Double / Float), `isNumeric()` will now return true.
Before this change, it returned False (tested with trycf.com on 5.3.7 and 4.5, and ACF 2021)
Code to test:
Output on Lucee 220.127.116.11-RC:
I've checked this ticket with fixed versions and this issue was fixed. So I close this ticket.
Awesome @Michael Offner ! Everything looks good now, as far as I can read the code on my mobile.
And p.s.: Hi buddy👋 Long time no see 😁
I extended the existing isNumber function and removed the addional independent check, i also added all test cases.
I was checking this commit, and with that, the actual implementation. I see there are 2 different isNumeric() implementations, which both try to do the same, but in a completely different manner:
Worse even, the implementation isNumber(String str) still does not allow for a negative exponent, like 3e-5, if I read the code correctly.
My suggestion would be, to start using just one of the 2 implementations, and remove the other one.
If using the string parser, you could add a few tests for the things tested in this function, eg.