[wp-trac] [WordPress Trac] #38445: Rest Sanitize Boolean
WordPress Trac
noreply at wordpress.org
Sat Oct 22 11:23:25 UTC 2016
#38445: Rest Sanitize Boolean
-------------------------+-----------------------------
Reporter: wido | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
Since version 4.7.0 a new function named
<strong>rest_sanitize_boolean</strong> is added to the rest-api core.
This function seems to be a general function ( that per documentation
''Changes a boolean-like value into the proper boolean value.'' ) rather
than a specific function that works only within the restapi context.
We had a discussion about this in #core-restapi and they tell me that the
purpose of the function is when a request is made via GET like
?hide_empty=false or ?hide_empty=0 for example.
The value is evaluated as a string, so this when the function come into
play.
Can this function be useful even in general context when a form validation
is performed via $_GET or $_POST.
So, may I propose to move the function within the
<strong>formatting.php</strong> so that we can benefit in various
situations?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38445>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list