[wp-trac] [WordPress Trac] #43977: Fix error-prone string to array parsing

WordPress Trac noreply at wordpress.org
Tue Oct 2 20:15:39 UTC 2018


#43977: Fix error-prone string to array parsing
----------------------------------------+-----------------------
 Reporter:  flixos90                    |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  5.0
Component:  General                     |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:  rest-api
----------------------------------------+-----------------------

Comment (by david.binda):

 Examining the implementation of the
 `WP_REST_Settings_Controller::get_item` and
 `WP_REST_Settings_Controller::prepare_value` further, it looks like not
 attempting to parse `null` by `wp_parse_list` inside the
 `rest_validate_value_from_schema` function should do the trick for
 preventing current implementation, which feels correct after all.

 I'm attaching enhanced diff.

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


More information about the wp-trac mailing list