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

WordPress Trac noreply at wordpress.org
Tue Oct 11 18:21:14 UTC 2016


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

Comment (by joemcgill):

 Replacing `$_SERVER['SERVER_NAME']` with output from a helper function in
 these instances seems like a good idea to me and could be useful outside
 of instances where we're building email addresses. I question whether this
 should be a pluggable function, though. This function feels more like
 `get_site_url()` or `get_home_url()` which live in `wp-includes/link-
 template.php`.

 I also wonder if it was an oversight that none of the multisite functions
 were stripping `www` subdomain prefixes or if that was intentionally
 allowed? Either way, [attachment:25239.4.patch] has a redundant
 `preg_replace()` call if that method is used inside the helper function.

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


More information about the wp-trac mailing list