#28170 closed enhancement (fixed)
Add utility method for casting a var to boolean
Reported by: | wonderboymusic | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
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()
.
Attachments (1)
Change History (4)
This ticket was mentioned in IRC in #wordpress-dev by wonderboymusic. View the logs.
11 years ago
#2
@
11 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
This ticket was mentioned in Slack in #core-restapi by ocean90. View the logs.
8 years ago
Note: See
TracTickets for help on using
tickets.
In 28542: