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:
Back
Top Bottom