[wp-trac] [WordPress Trac] #38984: REST API: Fix incorrect calls to `rest_sanitize_value_from_schema`

WordPress Trac noreply at wordpress.org
Wed Nov 30 02:07:34 UTC 2016


#38984: REST API: Fix incorrect calls to `rest_sanitize_value_from_schema`
--------------------------+--------------------
 Reporter:  jnylen0       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.7
Component:  REST API      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------

Comment (by rachelbaker):

 Replying to [comment:4 jnylen0]:
 > Replying to [comment:3 rachelbaker]:
 > > @jnylen0 for the username we can't simply use any string value. There
 are invalid characters that need to be stripped.
 >
 > This is already handled (see `validate_username` call in the
 `check_username` function, and
 [https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/rest-
 api/rest-users-controller.php?rev=39370#L725 associated tests])

 Ah. I had to scroll down :). Now I remember why I don't review patches on
 mobile.

 Why the change to `strval()` from the `(string)` typecasting?  Is there a
 reason to change that?  In the RC phase of a release I would prefer avoid
 non-bug code tweaks.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38984#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list