[wp-trac] [WordPress Trac] #45933: WSODs protection returns incorrect content type for JSON Requests

WordPress Trac noreply at wordpress.org
Mon Jan 21 11:13:15 UTC 2019


#45933: WSODs protection returns incorrect content type for JSON Requests
------------------------------------------------+------------------------
 Reporter:  spacedmonkey                        |       Owner:  flixos90
     Type:  defect (bug)                        |      Status:  reviewing
 Priority:  normal                              |   Milestone:  5.1
Component:  Bootstrap/Load                      |     Version:  trunk
 Severity:  normal                              |  Resolution:
 Keywords:  servehappy needs-testing has-patch  |     Focuses:  multisite
------------------------------------------------+------------------------

Comment (by schlessera):

 A few observations regarding the latest patch:

 - Line 3375: `$args['code'] = 500;` should be `$args['response'] = 500;`
 - Doing `empty()` checks on strings means that it is not possible to
 override a string like `$args['title']` to be an empty string. Just as
 well, doing `empty()` checks on integers means that it is not possible to
 override values like `$args['code']`. `isset()` or `array_key_exists()`
 checks would be more explicit and still allow for empty strings and the
 value `0` as a valid input.
 - `$args['response']` seems to have both `0` (line 3327) as well as `500`
 (line 3375) as default values. If it should be `0`, then some of the calls
 will be wrong, as setting of return code 500 is removed in some places by
 the patch (line 3024, line 3218, line 3257).
 - Code should be an integer but defaults to an empty string (line 3328).
 - Text direction could default to `ltr` to simplify the code (line 3332).

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


More information about the wp-trac mailing list