WordPress.org

Make WordPress Core

Ticket #1593: pluggable-functions.php.2.diff

File pluggable-functions.php.2.diff, 1.7 KB (added by markjaquith, 9 years ago)

patch for wp 1.6 SVN (take 2)

  • wp-includes/pluggable-functions.php

     
    277277        $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 
    278278        $notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n"; 
    279279 
    280         if ('' == $comment->comment_author_email || '' == $comment->comment_author) { 
    281                 $from = "From: \"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>'; 
     280        $admin_email = get_settings('admin_email'); 
     281 
     282        if ( '' == $comment->comment_author ) { 
     283                $from = "From: \"$blogname\" <$admin_email>"; 
     284                if ( '' != $comment->comment_author_email ) 
     285                        $reply_to = "Reply-To: $comment->comment_author_email"; 
    282286        } else { 
    283                 $from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>"; 
     287                $from = "From: \"$comment->comment_author\" <$admin_email>"; 
     288                if ( '' != $comment->comment_author_email ) 
     289                        $reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>"; 
    284290        } 
    285291 
    286292        $message_headers = "MIME-Version: 1.0\n" 
    287293                . "$from\n" 
    288294                . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n"; 
    289295 
     296        if ( $reply_to ) 
     297                $message_headers .= $reply_to . "\n"; 
     298 
    290299        $notify_message = apply_filters('comment_notification_text', $notify_message); 
    291300        $subject = apply_filters('comment_notification_subject', $subject); 
    292301        $message_headers = apply_filters('comment_notification_headers', $message_headers);