[wp-trac] [WordPress Trac] #16974: absint to return 0 for values that with non-numeric characters
WordPress Trac
wp-trac at lists.automattic.com
Sat Mar 26 17:49:55 UTC 2011
#16974: absint to return 0 for values that with non-numeric characters
--------------------------+-----------------------------
Reporter: sc0ttkclark | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.1
Severity: minor | Keywords: has-patch
--------------------------+-----------------------------
Currently, if you put in a string into absint which contains non-numeric
characters after numeric characters it will return the number before the
non-numeric characters as the number, which I believe isn't the valid
return for absint($maybeint)
The solution I am proposing is to check if $maybeint isn't numeric, and if
not then return 0;
See the attached patch.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16974>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list