Make WordPress Core

Ticket #25239: 25239.r47544.patch

File 25239.r47544.patch, 3.0 KB (added by chesio, 5 years ago)

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

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

     
    946946        $activate_url = esc_url( $activate_url );
    947947        $admin_email  = get_site_option( 'admin_email' );
    948948        if ( '' == $admin_email ) {
    949                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     949                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    950950        }
    951951        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    952952        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
     
    10711071        // Send email with activation link.
    10721072        $admin_email = get_site_option( 'admin_email' );
    10731073        if ( '' == $admin_email ) {
    1074                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1074                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    10751075        }
    10761076        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
    10771077        $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n";
     
    16351635        $admin_email   = get_site_option( 'admin_email' );
    16361636
    16371637        if ( '' == $admin_email ) {
    1638                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1638                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    16391639        }
    16401640
    16411641        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
     
    17271727        $admin_email = get_site_option( 'admin_email' );
    17281728
    17291729        if ( '' == $admin_email ) {
    1730                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1730                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    17311731        }
    17321732
    17331733        $from_name       = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
  • src/wp-includes/pluggable.php

     
    328328                 */
    329329                if ( ! isset( $from_email ) ) {
    330330                        // Get the site domain and get rid of www.
    331                         $sitename = strtolower( $_SERVER['SERVER_NAME'] );
     331                        $sitename = wp_parse_url( network_home_url(), PHP_URL_HOST );
    332332                        if ( substr( $sitename, 0, 4 ) == 'www.' ) {
    333333                                $sitename = substr( $sitename, 4 );
    334334                        }
     
    16401640                        $notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
    16411641                }
    16421642
    1643                 $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', strtolower( $_SERVER['SERVER_NAME'] ) );
     1643                $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', wp_parse_url( network_home_url(), PHP_URL_HOST ) );
    16441644
    16451645                if ( '' == $comment->comment_author ) {
    16461646                        $from = "From: \"$blogname\" <$wp_email>";