[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 27 09:23:07 UTC 2017
#39881: `WP_REST_Posts_Controller::check_read_permission()` should check if
`$parent` exists before calling itself
-------------------------------------------------+-------------------------
Reporter: GhostToast | Owner:
Type: defect (bug) | rachelbaker
Priority: normal | Status: closed
Component: REST API | Milestone: 4.7.4
Severity: normal | Version: 4.7
Keywords: has-patch has-unit-tests fixed- | Resolution: fixed
major | Focuses: rest-api
-------------------------------------------------+-------------------------
Changes (by swissspidy):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"40337"]:
{{{
#!CommitTicketReference repository="" revision="40337"
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.
Merges [40306] to the 4.7 branch.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39881#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list