Skip to content

Commit 4127661

Browse files
committed
Media: Ensure the attachment parent is accessible to the user before showing a link to it in the media manager.
Merges [61884] to the 6.9 branch. Props johnbillion, peterwilsoncc. git-svn-id: https://develop.svn.wordpress.org/branches/6.9@61895 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e63707c commit 4127661

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/wp-includes/media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4570,7 +4570,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
45704570

45714571
if ( $attachment->post_parent ) {
45724572
$post_parent = get_post( $attachment->post_parent );
4573-
if ( $post_parent ) {
4573+
if ( $post_parent && current_user_can( 'read_post', $attachment->post_parent ) ) {
45744574
$response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );
45754575
$response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' );
45764576
}

0 commit comments

Comments
 (0)