Ticket #1528 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

Unsigned validator does not support float values and validates strings

Reported by: hwestphal Owned by: jwage
Priority: minor Milestone: 1.0.4
Component: Validators Version: 1.0.0
Severity: Keywords: unsigned validator
Cc: Has Test: no
Status: Pending Core Response Has Patch: yes

Description

the current unsigned validator only supports integer values, if you try to validate (float) 5.9 it will return false. the inline documentation says checks if given value is a valid unsigned integer, so this is not really the bug.

the problem is that if you try to validate "five" it would return true ;-)

and because of the general name of this validator one would expect that it supports floats as well :-)

i wrote a patch which supports both int and float values and which does not return true if the value is "five"

Attachments

unsignedValidator.patch (1.3 KB) - added by hwestphal 9 months ago.

Change History

Changed 9 months ago by hwestphal

Changed 9 months ago by jwage

  • milestone set to 1.0.4

Changed 9 months ago by jwage

  • status changed from new to closed
  • resolution set to fixed

(In [5091]) [1.0, 1.1] fixes #1528 - issue with unsigned validator and float/string values

Note: See TracTickets for help on using tickets.