[wp-trac] [WordPress Trac] #25239: $_SERVER['SERVER_NAME'] not a reliable when generating email host names

WordPress Trac noreply at wordpress.org
Thu May 22 20:15:18 UTC 2014


#25239: $_SERVER['SERVER_NAME'] not a reliable when generating email host names
-------------------------------------------------+-------------------------
 Reporter:  layotte                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Mail                                 |  Review
 Severity:  normal                               |     Version:  3.8
 Keywords:  has-patch dev-feedback needs-        |  Resolution:
  testing                                        |     Focuses:
-------------------------------------------------+-------------------------

Comment (by jesin):

 Tested `25239.diff` on a multisite Nginx environment with the following
 code.

 {{{
 add_filter( 'pre_site_option_admin_email', function() {
         return '';
 });
 wpmu_signup_user_notification( 'jesin', 'my at email.com', 'abcd' );
 wpmu_welcome_notification( 2, 1, 'password', 'Hello World' );
 wpmu_welcome_user_notification( 1, 'password' );
 wpmu_signup_blog_notification( 'example.com', '/', 'Hello World', 'jesin',
 'my at email.com', 'abcd' );
 wp_mail( 'my at email.com', 'Subject', 'A message without From: header' );
 }}}

 This patch uses `home_url()` for single site and `$current_blog->domain`
 for multisite inside functions `wp_mail()` and `wp_notify_postauthor()`
 because `home_url()` returns the subdomain even if domain mapping is
 configured.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25239#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list