[wp-trac] [WordPress Trac] #28170: Add utility method for casting a var to boolean
WordPress Trac
noreply at wordpress.org
Wed May 7 19:44:57 UTC 2014
#28170: Add utility method for casting a var to boolean
----------------------------+-----------------------
Reporter: wonderboymusic | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.0
Component: General | Version: trunk
Severity: normal | Keywords: has-patch
Focuses: |
----------------------------+-----------------------
Because PHP can be configured without `--filter`, it is not 100% safe to
use `filter_var()`. This is problematic for casting `"false"` to `false`,
as PHP always casts it to `true`. `FILTER_VALIDATE_BOOLEAN` fixes this,
but it may not be available.
Proposed new function: `wp_validate_boolean()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28170>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list