Ticket #25239: server_name.diff
File server_name.diff, 4.3 KB (added by , 10 years ago) |
---|
-
wp-includes/ms-functions.php
723 723 $activate_url = esc_url($activate_url); 724 724 $admin_email = get_site_option( 'admin_email' ); 725 725 if ( $admin_email == '' ) 726 $admin_email = 'support@' . $ _SERVER['SERVER_NAME'];726 $admin_email = 'support@' . $current_site->domain; 727 727 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 728 728 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 729 729 $message = sprintf( … … 770 770 * @return bool 771 771 */ 772 772 function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array() ) { 773 global $current_site; 774 773 775 if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) ) 774 776 return false; 775 777 … … 776 778 // Send email with activation link. 777 779 $admin_email = get_site_option( 'admin_email' ); 778 780 if ( $admin_email == '' ) 779 $admin_email = 'support@' . $ _SERVER['SERVER_NAME'];781 $admin_email = 'support@' . $current_site->domain; 780 782 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 781 783 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 782 784 $message = sprintf( … … 1236 1238 $admin_email = get_site_option( 'admin_email' ); 1237 1239 1238 1240 if ( $admin_email == '' ) 1239 $admin_email = 'support@' . $ _SERVER['SERVER_NAME'];1241 $admin_email = 'support@' . $current_site->domain; 1240 1242 1241 1243 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 1242 1244 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; … … 1284 1286 $admin_email = get_site_option( 'admin_email' ); 1285 1287 1286 1288 if ( $admin_email == '' ) 1287 $admin_email = 'support@' . $ _SERVER['SERVER_NAME'];1289 $admin_email = 'support@' . $current_site->domain; 1288 1290 1289 1291 $from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); 1290 1292 $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; -
wp-includes/pluggable.php
218 218 if ( !is_array($attachments) ) 219 219 $attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) ); 220 220 221 global $phpmailer ;221 global $phpmailer, $current_site; 222 222 223 223 // (Re)create it, if it's gone missing 224 224 if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) { … … 326 326 * http://trac.wordpress.org/ticket/5007. 327 327 */ 328 328 329 if ( !isset( $from_email ) ) { 330 // Get the site domain and get rid of www. 331 $sitename = strtolower( $_SERVER['SERVER_NAME'] ); 332 if ( substr( $sitename, 0, 4 ) == 'www.' ) { 333 $sitename = substr( $sitename, 4 ); 334 } 329 if ( !isset( $from_email ) ) 330 $from_email = 'wordpress@' . $current_site->domain; 335 331 336 $from_email = 'wordpress@' . $sitename;337 }338 339 332 // Plugin authors can override the potentially troublesome default 340 333 $phpmailer->From = apply_filters( 'wp_mail_from' , $from_email ); 341 334 $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name ); … … 1007 1000 * @return bool False if user email does not exist. True on completion. 1008 1001 */ 1009 1002 function wp_notify_postauthor( $comment_id, $comment_type = '' ) { 1003 global $current_site; 1004 1010 1005 $comment = get_comment( $comment_id ); 1011 1006 $post = get_post( $comment->comment_post_ID ); 1012 1007 $author = get_userdata( $post->post_author ); … … 1076 1071 $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n"; 1077 1072 } 1078 1073 1079 $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));1074 $wp_email = 'wordpress@' . $current_site->domain; 1080 1075 1081 1076 if ( '' == $comment->comment_author ) { 1082 1077 $from = "From: \"$blogname\" <$wp_email>";