From f88996bed75900b1fe00b5a76882e011df97a4a4 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 4 Jun 2015 17:29:25 +0000 Subject: [PATCH] In `wp_notify_moderator()`, don't throw notice when comment belongs to a post with no author. Props Oxymoron. Fixes #32566. Built from https://develop.svn.wordpress.org/trunk@32692 git-svn-id: http://core.svn.wordpress.org/trunk@32662 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index fc0356aedf..a166ab017a 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1550,7 +1550,7 @@ function wp_notify_moderator($comment_id) { $user = get_userdata( $post->post_author ); // Send to the administration and to the post author if the author can modify the comment. $emails = array( get_option( 'admin_email' ) ); - if ( user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) { + if ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) { if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) $emails[] = $user->user_email; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 5b6b5ebda1..6277a17e76 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32691'; +$wp_version = '4.3-alpha-32692'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.