Ticket #26659: 26659-checking-added.patch
| File 26659-checking-added.patch, 1.5 KB (added by , 12 years ago) |
|---|
-
wp-includes/pluggable.php
1023 1023 $author = get_userdata( $post->post_author ); 1024 1024 1025 1025 // Who to notify? By default, just the post author, but others can be added. 1026 $emails = array( $author->user_email ); 1026 $emails = array(); 1027 if ( ! empty( $author ) ) { 1028 $emails[] = $author->user_email; 1029 } 1027 1030 1028 1031 /** 1029 1032 * Filter the list of emails to receive a comment notification. … … 1061 1064 $notify_author = apply_filters( 'comment_notification_notify_author', false, $comment_id ); 1062 1065 1063 1066 // The comment was left by the author 1064 if ( ! $notify_author && $comment->user_id == $post->post_author ) {1067 if ( ! $notify_author && $comment->user_id == $post->post_author && ! empty( $author ) ) { 1065 1068 unset( $emails[ $author->user_email ] ); 1066 1069 } 1067 1070 1068 1071 // The author moderated a comment on their own post 1069 if ( ! $notify_author && $post->post_author == get_current_user_id() ) {1072 if ( ! $notify_author && $post->post_author == get_current_user_id() && ! empty( $author ) ) { 1070 1073 unset( $emails[ $author->user_email ] ); 1071 1074 } 1072 1075 1073 1076 // The post author is no longer a member of the blog 1074 if ( ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) {1077 if ( ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) && ! empty( $author ) ) { 1075 1078 unset( $emails[ $author->user_email ] ); 1076 1079 } 1077 1080