Changeset 32692
- Timestamp:
- 06/04/2015 05:28:07 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r32614 r32692 1551 1551 // Send to the administration and to the post author if the author can modify the comment. 1552 1552 $emails = array( get_option( 'admin_email' ) ); 1553 if ( user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) {1553 if ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) { 1554 1554 if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) 1555 1555 $emails[] = $user->user_email; -
trunk/tests/phpunit/tests/comment.php
r32364 r32692 149 149 } 150 150 } 151 152 /** 153 * @ticket 32566 154 */ 155 public function test_wp_notify_moderator_should_not_throw_notice_when_post_author_is_0() { 156 $p = $this->factory->post->create( array( 157 'post_author' => 0, 158 ) ); 159 160 $c = $this->factory->comment->create( array( 161 'comment_post_ID' => $p, 162 ) ); 163 164 $this->assertTrue( wp_notify_moderator( $c ) ); 165 } 151 166 }
Note: See TracChangeset
for help on using the changeset viewer.