Default behaviour change for includedMinimum and includeMaximum of StringLength Validator on 5.9? #16754
Replies: 2 comments
-
I don't recall making a change to that from v5.8 to v5.9. I will check and revert it if necessary. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response. It seems related to #16560. When defining 'includeMaximum' and 'includeMinimum' (or just 'include' for Max/Min), apparently the behaviour was 'inverted' in earlier versions. As a side-effect of that being fixed, the implicit behaviour (when include is not defined) has changed with it: [diff 5.8.0 / 5.9.2] phalcon/Filter/Validation/Validator/StringLength/Max.zep We can live with that, we'll adjust our code (but it may be worth noting on the 5.9.x release notes). |
Beta Was this translation helpful? Give feedback.
-
We recently got the 5.9 update of Phalcon (coming from 5.8 before), and suddenly our application started to fail on the StringLength validator. The case is where StringLength validation is used to check for an exact string length (min == max). For example:
On version 5.8, this seems to default to 'includeMaximum = true' and 'includeMinimum = true'. Starting with 5.9, it seems the default for these parameters is now 'false', resulting in validation errors. Of course we can fix this by explicitly defining includeMaximum and includeMinimum, but we were wondering why a minor revision would break with default behaviour. And if it does, why this isn't listed as a breaking change on the release notes?
Beta Was this translation helpful? Give feedback.
All reactions