Comment type is not correctly passed to wp_notify_postauthor in wp_new_comment()
|Reported by:||solarissmoke||Owned by:|
Line 1285 of wp-includes/comment.php (part of wp_new_comment) reads as follows:
wp_notify_postauthor($comment_ID, empty( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
The ternary operation is flawed. If $commentdatacomment_type? is empty, then that empty value is returned. If it isn't empty, then an empty string is returned. Either way, an empty value is always passed to wp_notify_postauthor.
I think the check should be !empty() instead. That way a non-empty value is passed properly to the function. Proposed patch attached.