Make WordPress Core

Ticket #25239: 25239.r44770.patch

File 25239.r44770.patch, 3.0 KB (added by chesio, 6 years ago)

Refresh of 23236.7.patch for current trunk (revision 44770)

  • src/wp-includes/ms-functions.php

     
    913913        $activate_url = esc_url( $activate_url );
    914914        $admin_email  = get_site_option( 'admin_email' );
    915915        if ( $admin_email == '' ) {
    916                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     916                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    917917        }
    918918        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    919919        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
     
    10361036        // Send email with activation link.
    10371037        $admin_email = get_site_option( 'admin_email' );
    10381038        if ( $admin_email == '' ) {
    1039                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1039                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    10401040        }
    10411041        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    10421042        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
     
    15861586        $admin_email   = get_site_option( 'admin_email' );
    15871587
    15881588        if ( $admin_email == '' ) {
    1589                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1589                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    15901590        }
    15911591
    15921592        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
     
    16771677        $admin_email = get_site_option( 'admin_email' );
    16781678
    16791679        if ( $admin_email == '' ) {
    1680                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1680                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    16811681        }
    16821682
    16831683        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
  • src/wp-includes/pluggable.php

     
    330330
    331331                if ( ! isset( $from_email ) ) {
    332332                        // Get the site domain and get rid of www.
    333                         $sitename = strtolower( $_SERVER['SERVER_NAME'] );
     333                        $sitename = wp_parse_url( network_home_url(), PHP_URL_HOST );
    334334                        if ( substr( $sitename, 0, 4 ) == 'www.' ) {
    335335                                $sitename = substr( $sitename, 4 );
    336336                        }
     
    15821582                        $notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
    15831583                }
    15841584
    1585                 $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', strtolower( $_SERVER['SERVER_NAME'] ) );
     1585                $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', wp_parse_url( network_home_url(), PHP_URL_HOST ) );
    15861586
    15871587                if ( '' == $comment->comment_author ) {
    15881588                        $from = "From: \"$blogname\" <$wp_email>";
     
    27422742                return $r;
    27432743        }
    27442744endif;
    2745