Fixes #1578 for 1.6

git-svn-id: http://svn.automattic.com/wordpress/trunk@2827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2005-08-30 23:17:42 +00:00
parent 8f184fb7a3
commit c9b3f35a83
1 changed files with 8 additions and 2 deletions

View File

@ -221,7 +221,6 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1"); $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1"); $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1");
if ('' == $user->user_email) return false; // If there's no email to send the comment to if ('' == $user->user_email) return false; // If there's no email to send the comment to
@ -268,6 +267,10 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
. "$from\n" . "$from\n"
. "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n"; . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
$notify_message = apply_filters('comment_notification_text', $notify_message);
$subject = apply_filters('comment_notification_subject', $subject);
$message_headers = apply_filters('comment_notification_headers', $message_headers);
@wp_mail($user->user_email, $subject, $notify_message, $message_headers); @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
return true; return true;
@ -305,7 +308,10 @@ function wp_notify_moderator($comment_id) {
$notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n"; $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n";
$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title ); $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_settings('blogname'), $post->post_title );
$admin_email = get_settings("admin_email"); $admin_email = get_settings('admin_email');
$notify_message = apply_filters('comment_moderation_text', $notify_message);
$subject = apply_filters('comment_moderation_subject', $subject);
@wp_mail($admin_email, $subject, $notify_message); @wp_mail($admin_email, $subject, $notify_message);