WordPress.org

Make WordPress Core

Ticket #5007: 5007.2.patch

File 5007.2.patch, 1.6 KB (added by pishmishy, 6 years ago)

Document the problems in the code

  • wp-includes/pluggable.php

     
    336336                $from_name = 'WordPress'; 
    337337        } 
    338338 
    339         // If we don't have an email from the input headers 
     339        /* If we don't have an email from the input headers default to wordpress@$sitename 
     340         * Some hosts will block outgoing mail from this address if it doesn't exist but 
     341         * there's no easy alternative. Defaulting to admin_email might appear to be another  
     342         * option but some hosts may refuse to relay mail from an unknown domain. See 
     343         * http://trac.wordpress.org/ticket/5007. 
     344         */ 
     345         
    340346        if ( !isset( $from_email ) ) { 
    341347                // Get the site domain and get rid of www. 
    342348                $sitename = strtolower( $_SERVER['SERVER_NAME'] ); 
     
    347353                $from_email = 'wordpress@' . $sitename; 
    348354        } 
    349355 
    350         // Set the from name and email 
     356        // Plugin authors can override the potentially troublesome default 
    351357        $phpmailer->From = apply_filters( 'wp_mail_from', $from_email ); 
    352358        $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); 
    353359 
  • wp-admin/includes/upgrade.php

     
    115115        $user = new WP_User($user_id); 
    116116        $email = $user->user_email; 
    117117        $name = $user->user_login; 
    118         $message_headers = 'From: "' . $blog_title . '" <wordpress@' . $_SERVER['SERVER_NAME'] . '>'; 
    119118        $message = sprintf(__("Your new WordPress blog has been successfully set up at: 
    120119 
    121120%1\$s