[wp-trac] [WordPress Trac] #39881: `WP_REST_Posts_Controller::check_read_permission()` should check if `$parent` exists before calling itself

WordPress Trac noreply at wordpress.org
Sat Mar 18 04:39:06 UTC 2017


#39881: `WP_REST_Posts_Controller::check_read_permission()` should check if
`$parent` exists before calling itself
---------------------------------------------+--------------------------
 Reporter:  GhostToast                       |       Owner:  rachelbaker
     Type:  defect (bug)                     |      Status:  reviewing
 Priority:  normal                           |   Milestone:  4.7.4
Component:  REST API                         |     Version:  4.7
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  rest-api
---------------------------------------------+--------------------------
Changes (by rachelbaker):

 * keywords:  has-patch dev-feedback needs-unit-tests => has-patch has-unit-
     tests commit


Comment:

 In [attachment:39881.2.diff] I added two unit tests. The first test
 returns the media file successfully with the post_parent is invalid but
 the post_status is `inherit`.  The second returns an error if the
 post_parent is invalid but the post_status is `auto-draft`.

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


More information about the wp-trac mailing list