You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NotEmpty validator considers string ' ' empty by default due to space case. It is a surprising behavior that apparently got inherited from ZF1 over 12 years ago.
In case of laminas-inputfilter it would be a filter responsibility to remove spaces or anything else like line feed before validation.
I would say this condition is useful only for laminas-form and only for a sloppy input filter definitions. This case should really be handled by the trim filter.
The text was updated successfully, but these errors were encountered:
I kind of agree, but validator does not depend on filter or input-filter - I don't think it's unreasonable to consider as a validation failure by default. You could make the argument that input should be filtered by the ToNull filter which would negate the need for self::STRING and self::EMPTY_ARRAY too probably.
If you have strong feelings here, v3 is getting pretty close…
NotEmpty validator considers string
' '
empty by default due tospace
case. It is a surprising behavior that apparently got inherited from ZF1 over 12 years ago.laminas-validator/src/NotEmpty.php
Lines 64 to 71 in fac99d7
In case of laminas-inputfilter it would be a filter responsibility to remove spaces or anything else like line feed before validation.
I would say this condition is useful only for laminas-form and only for a sloppy input filter definitions. This case should really be handled by the trim filter.
The text was updated successfully, but these errors were encountered: