Make WordPress Core

Ticket #25239: 25239.3.diff

File 25239.3.diff, 2.7 KB (added by whyisjake, 4 years ago)
  • src/wp-includes/ms-functions.php

     
    952952        $admin_email = get_site_option( 'admin_email' );
    953953
    954954        if ( '' === $admin_email ) {
    955                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     955                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    956956        }
    957957
    958958        $from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
     
    10791079        $admin_email = get_site_option( 'admin_email' );
    10801080
    10811081        if ( '' === $admin_email ) {
    1082                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1082                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    10831083        }
    10841084
    10851085        $from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
     
    16631663        $admin_email = get_site_option( 'admin_email' );
    16641664
    16651665        if ( '' === $admin_email ) {
    1666                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1666                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    16671667        }
    16681668
    16691669        $from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
     
    17551755        $admin_email = get_site_option( 'admin_email' );
    17561756
    17571757        if ( '' === $admin_email ) {
    1758                 $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
     1758                $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
    17591759        }
    17601760
    17611761        $from_name       = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
  • 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 ( 'www.' === substr( $sitename, 0, 4 ) ) {
    335335                                $sitename = substr( $sitename, 4 );
    336336                        }
     
    16501650                        $notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n";
    16511651                }
    16521652
    1653                 $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', strtolower( $_SERVER['SERVER_NAME'] ) );
     1653                $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', wp_parse_url( network_home_url(), PHP_URL_HOST ) );
    16541654
    16551655                if ( '' === $comment->comment_author ) {
    16561656                        $from = "From: \"$blogname\" <$wp_email>";
     
    28312831                return $r;
    28322832        }
    28332833endif;
    2834