[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
Mon Mar 20 04:29:53 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: closed
Priority: normal | Milestone: 4.7.4
Component: REST API | Version: 4.7
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests commit | Focuses: rest-api
---------------------------------------------+--------------------------
Changes (by rachelbaker):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"40306"]:
{{{
#!CommitTicketReference repository="" revision="40306"
REST API: Confirm the parent post object of an attachment exists in
`WP_REST_Posts_Controller::check_read_permission()`.
Avoid a PHP Error when attempting to embed the parent post of an
attachment, when the parent post ID is invalid. Instead check if the
parent post object exists before checking the read permission for the
parent post.
Props GhostToast.
Fixes #39881.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39881#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list