WordPress.org

Make WordPress Core

Ticket #1352: 1352.diff

File 1352.diff, 888 bytes (added by Nazgul, 8 years ago)
  • wp-includes/pluggable.php

     
    161161if ( !function_exists('wp_mail') ) : 
    162162function wp_mail($to, $subject, $message, $headers = '') { 
    163163        if( $headers == '' ) { 
    164                 $headers = "MIME-Version: 1.0\n" . 
    165                         "From: wordpress@" . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . "\n" .  
    166                         "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
     164                $headers = 'MIME-Version: 1.0\n' . 
     165                        'From: "' . sanitize_email(get_option('blogname')) . '" <wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . '>\n' .  
     166                        'Content-Type: text/plain; charset="' . get_option('blog_charset') . '"\n'; 
    167167        } 
    168168 
    169169        return @mail($to, $subject, $message, $headers);