Skip to content

Commit c556724

Browse files
committed
Media: Ensure the attachment parent is accessible to the user before showing a link to it in the media manager.
Props johnbillion, peterwilsoncc. git-svn-id: https://develop.svn.wordpress.org/trunk@61884 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0284532 commit c556724

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
@@ -4568,7 +4568,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
45684568

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

0 commit comments

Comments
 (0)