Number validation breaks in version 5.1.8
-
Update:
Duplicate of: https://www.ads-software.com/support/topic/the-number-is-larger-than-the-maximum-allowed/See screenshot link (https://prnt.sc/sjl4hs)
Version 5.1.8 breaks number validation due to a programming mistake where != was replaced with !==.
Since !== takes data types into account, this breaks the validation for number fields. In my case I have only tested this with one of my existing forms that have a number field which has no maximum specified, like so:
[number* Amount “1”]
The validation error says: Amount is more than the maximum.
Looking at the code, an empty string is compared to an int or float value:
” !== $value and ” !== $max and (float) $max < (float) $valueThis will always return false, thus validation will always fail (for all conditions shown in the screenshot).
I’d be happy to debug further and contribute but I’m not sure where to start (I don’t see a repo for cf7 on github).
- This topic was modified 4 years, 9 months ago by .
- This topic was modified 4 years, 9 months ago by . Reason: duplicate
The page I need help with: [log in to see the link]
- The topic ‘Number validation breaks in version 5.1.8’ is closed to new replies.