You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/12/29 06:03:21 UTC
DO NOT REPLY [Bug 32351] -
Float validator can't validate the string with several dot
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32351>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32351
martinc@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|dev@struts.apache.org |commons-
| |dev@jakarta.apache.org
Component|Validator Framework |Validator
Product|Struts |Commons
Version|1.2.4 |Nightly Builds
------- Additional Comments From martinc@apache.org 2004-12-29 06:03 -------
This looks like a Commons Validator bug to me. The validateFloat() function
splits the value on '.', but doesn't check the size of the resulting array
before going on to validate that the remaining characters are digits. As with
other JavaScript functions, parseFloat() doesn't error out when it reaches
something invalid, it just stops parsing.
The fix would be to check for "tempArray.length > 2" and error out in that
situation, since, for example, "1.2.0.2" would result in tempArray.length == 4,
which is clearly invalid.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org