From 98acab10eaa71282f56e3c2856ab6a26042299cd Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 10 Sep 2015 20:51:23 +0000 Subject: [PATCH] Comments/PHP Notices: check that a parent comment exists before displaying an orphan's link to it in the admin. Props rachelbaker. Fixes #33710. Built from https://develop.svn.wordpress.org/trunk@34015 git-svn-id: http://core.svn.wordpress.org/trunk@33984 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-comment.php | 24 ++++++++++--------- .../includes/class-wp-comments-list-table.php | 8 ++++--- wp-includes/version.php | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index d63420e106..dda2615134 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -119,17 +119,19 @@ if ( current_user_can( 'edit_post', $post_id ) ) { comment_parent ) : $parent = get_comment( $comment->comment_parent ); - $parent_link = esc_url( get_comment_link( $comment->comment_parent ) ); - $name = get_comment_author( $parent->comment_ID ); -?> -
- ' . $name . '' - ); ?> -
- + if ( $parent ) : + $parent_link = esc_url( get_comment_link( $comment->comment_parent ) ); + $name = get_comment_author( $parent->comment_ID ); + ?> +
+ ' . $name . '' + ); ?> +
+ comment_parent ) { $parent = get_comment( $comment->comment_parent ); - $parent_link = esc_url( get_comment_link( $parent ) ); - $name = get_comment_author( $parent ); - printf( ' | '.__( 'In reply to %2$s.' ), $parent_link, $name ); + if ( $parent ) { + $parent_link = esc_url( get_comment_link( $parent ) ); + $name = get_comment_author( $parent ); + printf( ' | '.__( 'In reply to %2$s.' ), $parent_link, $name ); + } } echo ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index e0fda922da..b8c9e29b91 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34014'; +$wp_version = '4.4-alpha-34015'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.