diff -ur wordpress.461/wp-includes/ms-functions.php wordpress/wp-includes/ms-functions.php
old
|
new
|
|
797 | 797 | $activate_url = esc_url($activate_url); |
798 | 798 | $admin_email = get_site_option( 'admin_email' ); |
799 | 799 | if ( $admin_email == '' ) |
800 | | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 800 | $admin_email = 'support@' . get_current_domain(); |
801 | 801 | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
802 | 802 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
803 | 803 | $message = sprintf( |
… |
… |
|
890 | 890 | // Send email with activation link. |
891 | 891 | $admin_email = get_site_option( 'admin_email' ); |
892 | 892 | if ( $admin_email == '' ) |
893 | | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 893 | $admin_email = 'support@' . get_current_domain(); |
894 | 894 | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
895 | 895 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
896 | 896 | $message = sprintf( |
… |
… |
|
1492 | 1492 | $admin_email = get_site_option( 'admin_email' ); |
1493 | 1493 | |
1494 | 1494 | if ( $admin_email == '' ) |
1495 | | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 1495 | $admin_email = 'support@' . get_current_domain(); |
1496 | 1496 | |
1497 | 1497 | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
1498 | 1498 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
… |
… |
|
1570 | 1570 | $admin_email = get_site_option( 'admin_email' ); |
1571 | 1571 | |
1572 | 1572 | if ( $admin_email == '' ) |
1573 | | $admin_email = 'support@' . $_SERVER['SERVER_NAME']; |
| 1573 | $admin_email = 'support@' . get_current_domain(); |
1574 | 1574 | |
1575 | 1575 | $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); |
1576 | 1576 | $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; |
diff -ur wordpress.461/wp-includes/pluggable.php wordpress/wp-includes/pluggable.php
old
|
new
|
|
322 | 322 | */ |
323 | 323 | |
324 | 324 | if ( !isset( $from_email ) ) { |
325 | | // Get the site domain and get rid of www. |
326 | | $sitename = strtolower( $_SERVER['SERVER_NAME'] ); |
327 | | if ( substr( $sitename, 0, 4 ) == 'www.' ) { |
328 | | $sitename = substr( $sitename, 4 ); |
329 | | } |
330 | | |
331 | | $from_email = 'wordpress@' . $sitename; |
| 325 | $from_email = 'wordpress@' . get_current_domain(); |
332 | 326 | } |
333 | 327 | |
334 | 328 | /** |
… |
… |
|
1466 | 1460 | $notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n"; |
1467 | 1461 | } |
1468 | 1462 | |
1469 | | $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); |
| 1463 | $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower( get_current_domain() )); |
1470 | 1464 | |
1471 | 1465 | if ( '' == $comment->comment_author ) { |
1472 | 1466 | $from = "From: \"$blogname\" <$wp_email>"; |
… |
… |
|
2452 | 2446 | } |
2453 | 2447 | endif; |
2454 | 2448 | |
| 2449 | if ( !function_exists( 'get_current_domain' ) ) : |
| 2450 | /** |
| 2451 | * Retrieve the domain name for the current site, with leading www. stripped. |
| 2452 | * Intended for use in sending emails. |
| 2453 | * |
| 2454 | * @since 4.7.0 |
| 2455 | * |
| 2456 | * @return string Domain name for the current site |
| 2457 | */ |
| 2458 | function get_current_domain () { |
| 2459 | $dom = parse_url( get_home_url( get_current_blog_id() ), PHP_URL_HOST ); |
| 2460 | return preg_replace('#^www\.#', '', strtolower( $dom )); |
| 2461 | } |
| 2462 | endif; |