Make WordPress Core

Ticket #25239: server_name.diff

File server_name.diff, 4.3 KB (added by layotte, 10 years ago)

Replace $_SERVERSERVER_NAME? w/ $current_site->domain

  • wp-includes/ms-functions.php

     
    723723        $activate_url = esc_url($activate_url);
    724724        $admin_email = get_site_option( 'admin_email' );
    725725        if ( $admin_email == '' )
    726                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     726                $admin_email = 'support@' . $current_site->domain;
    727727        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    728728        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    729729        $message = sprintf(
     
    770770 * @return bool
    771771 */
    772772function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array() ) {
     773        global $current_site;
     774       
    773775        if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) )
    774776                return false;
    775777
     
    776778        // Send email with activation link.
    777779        $admin_email = get_site_option( 'admin_email' );
    778780        if ( $admin_email == '' )
    779                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     781                $admin_email = 'support@' . $current_site->domain;
    780782        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    781783        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    782784        $message = sprintf(
     
    12361238        $admin_email = get_site_option( 'admin_email' );
    12371239
    12381240        if ( $admin_email == '' )
    1239                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1241                $admin_email = 'support@' . $current_site->domain;
    12401242
    12411243        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    12421244        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
     
    12841286        $admin_email = get_site_option( 'admin_email' );
    12851287
    12861288        if ( $admin_email == '' )
    1287                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1289                $admin_email = 'support@' . $current_site->domain;
    12881290
    12891291        $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    12901292        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
  • wp-includes/pluggable.php

     
    218218        if ( !is_array($attachments) )
    219219                $attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) );
    220220
    221         global $phpmailer;
     221        global $phpmailer, $current_site;
    222222
    223223        // (Re)create it, if it's gone missing
    224224        if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) {
     
    326326         * http://trac.wordpress.org/ticket/5007.
    327327         */
    328328
    329         if ( !isset( $from_email ) ) {
    330                 // Get the site domain and get rid of www.
    331                 $sitename = strtolower( $_SERVER['SERVER_NAME'] );
    332                 if ( substr( $sitename, 0, 4 ) == 'www.' ) {
    333                         $sitename = substr( $sitename, 4 );
    334                 }
     329        if ( !isset( $from_email ) )
     330                $from_email = 'wordpress@' . $current_site->domain;
    335331
    336                 $from_email = 'wordpress@' . $sitename;
    337         }
    338 
    339332        // Plugin authors can override the potentially troublesome default
    340333        $phpmailer->From     = apply_filters( 'wp_mail_from'     , $from_email );
    341334        $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name  );
     
    10071000 * @return bool False if user email does not exist. True on completion.
    10081001 */
    10091002function wp_notify_postauthor( $comment_id, $comment_type = '' ) {
     1003        global $current_site;
     1004       
    10101005        $comment = get_comment( $comment_id );
    10111006        $post    = get_post( $comment->comment_post_ID );
    10121007        $author  = get_userdata( $post->post_author );
     
    10761071                $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n";
    10771072        }
    10781073
    1079         $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
     1074        $wp_email = 'wordpress@'  . $current_site->domain;
    10801075
    10811076        if ( '' == $comment->comment_author ) {
    10821077                $from = "From: \"$blogname\" <$wp_email>";