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

WordPress Trac noreply at wordpress.org
Fri May 23 01:30:27 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 kitchin):

 Replying to [ticket:25239 layotte]:
 > I propose we move away from `$_SERVER['SERVER_NAME']` when generating
 the from email addresses and use the available $current_site global object
 which stores the domain variable ($current_site->domain).

 I suggest also moving away from `$_SERVER['HTTP_HOST']`. At first glance,
 HTTP_HOST seems worse because it's more closely derived from user input,
 but actually both can be buggy depending on the web server. Apache has had
 bugs. See http://stackoverflow.com/questions/2297403/http-host-vs-server-
 name for a pretty detailed write-up of SERVER_NAME vs. HTTP_HOST.

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


More information about the wp-trac mailing list