WordPress.org

Plugin Directory

Changeset 616417


Ignore:
Timestamp:
10/23/12 17:58:55 (18 months ago)
Author:
tmoorewp
Message:

Contact Form: Fix a bug where some web hosts would reject mail from the contact form due to email address spoofing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/modules/contact-form/grunion-contact-form.php

    r614138 r616417  
    955955        } 
    956956 
    957         $from_email_addr = $to[0]; 
    958         if ( !empty( $comment_author_email ) ) { 
    959             $from_email_addr = $comment_author_email; 
    960         } 
    961  
    962         $headers = 'From: ' . $comment_author  . 
    963             ' <' . $from_email_addr  . ">\r\n" . 
    964             'Reply-To: ' . $from_email_addr  . "\r\n" . 
    965             "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"";  
     957        $blog_url = parse_url( site_url() ); 
     958        $from_email_addr = 'wordpress@' . $blog_url['host']; 
     959 
     960        $reply_to_addr = $to[0]; 
     961        if ( ! empty( $comment_author_email ) ) { 
     962            $reply_to_addr = $comment_author_email; 
     963        } 
     964 
     965        $headers =  'From: ' . $comment_author  .' <' . $from_email_addr  . ">\r\n" . 
     966                    'Reply-To: ' . $comment_author . ' <' . $reply_to_addr  . ">\r\n" . 
     967                    "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"";  
    966968 
    967969        $subject = apply_filters( 'contact_form_subject', $contact_form_subject ); 
Note: See TracChangeset for help on using the changeset viewer.