#28170 closed enhancement (fixed)
Add utility method for casting a var to boolean
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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.
12 years ago
#2
@
12 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.
9 years ago
Note: See
TracTickets for help on using
tickets.
In 28542: