Design issue InputFilterer::filter 'posint' data corruption

vbresults

Well-known member
Affected version
2.3.7
Whenever an empty value is supplied to a POSINT field, InputFilterer::cleanInternal converts it to a 1 instead of omitting it. NUM, UNUM, and FLOAT have the same problem in the appropriate setting when the value is out of range.

I understand it's clamping the values, but this is opaque and results in unexpected behavior. Type casting and mutation should be separate so the latter is explicit, or a descriptive exception should be thrown and marked with @throws.
 
Last edited:
I'm not sure we can really change this as-is since it breaks backwards-compatibility. You can use eg. ?posint to allow for null values for missing data if that's preferable.
 
Back
Top Bottom