Page MenuHomePhabricator

Fix API parameter integer validation to actually enforce validation on the input values in addition to giving a warning. Also add flag to enforce (die) if integer out of range
Closed, ResolvedPublic


Per bug 25290, have a way of getting the API to die if value provided > max, rather than just warning and using max for limit, or just using the value literally as integer (ouch)

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:17 PM
bzimport set Reference to bz25303.

matthew.britton wrote:

Useful to have, but warning and using max for limit is usually OK, it's warning and then using the original value that is the problem.

matthew.britton wrote:

Changing severity from 'enhancement' to 'normal'. The current behavior, is, if not actually broken, at least very misleading for extension authors expecting the API to validate their parameters -- happened once, and will happen again.

The validation should be changed to restrict values to within the min/max range by default, as well as issuing a warning. Technically this is a BREAKING CHANGE (omg), but I can't imagine anyone is relying on the existing behavior.

Dying with an error on out of range values is an enhancement that could be added separately.

Changed summary to better describe the problem.

Done in r74230, 74232, 74234, 74235

Made the "breaking change", need to announce that (no urgency, but will do)