Mail: Ensure that a server hostname can be set by using network_home_url().
Due to the varying server setups, `$_SERVER['SERVER_NAME'];` can't reliably ensure that there will be a relevant host that could be used as the hostname in an email. Since the `network_home_url()` is set at this point, and is filterable, this should better enable emails to be sent from the server. Fixes #25239. Props layotte, SergeyBiryukov, nacin, sreedoap, szepe.viktor, jesin, kitchin, mensmaximus, mt8.biz, Grzegorz.Janoszka, cbutlerjr, dd32, BjornW, neodjandre, BjornW, Ipstenu, ocean90, danielbachhuber, desmith, joemcgill, jdgrimes, riasat, derekakelly, swissspidy, lilmike, tsimmons, robert.peake, DavidAnderson, cloudstek, pigdog234, BjornW, rawrly, pessoft, RedSand, seayou, dvershinin, bastho, chesio, Starbuck, afragen, ocean90, whyisjake. Built from https://develop.svn.wordpress.org/trunk@48601 git-svn-id: http://core.svn.wordpress.org/trunk@48363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -952,7 +952,7 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $us
|
||||
$admin_email = get_site_option( 'admin_email' );
|
||||
|
||||
if ( '' === $admin_email ) {
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
$from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
|
||||
@@ -1079,7 +1079,7 @@ function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta =
|
||||
$admin_email = get_site_option( 'admin_email' );
|
||||
|
||||
if ( '' === $admin_email ) {
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
$from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
|
||||
@@ -1663,7 +1663,7 @@ We hope you enjoy your new site. Thanks!
|
||||
$admin_email = get_site_option( 'admin_email' );
|
||||
|
||||
if ( '' === $admin_email ) {
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
$from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
|
||||
@@ -1755,7 +1755,7 @@ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() )
|
||||
$admin_email = get_site_option( 'admin_email' );
|
||||
|
||||
if ( '' === $admin_email ) {
|
||||
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
|
||||
$admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
$from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress';
|
||||
|
||||
Reference in New Issue
Block a user