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

WordPress Trac noreply at wordpress.org
Mon Sep 26 18:08:41 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 Ipstenu):

 From #38161

 > Using something like  {{{substr( home_url( '', 'http'),7)}}} might be a
 suitable substitute when $_SERVER is unavailable. (If there's a better way
 to get a site's hostname than slicing up home_url() that of course would
 work too.)

 We'd want to use parse_url() I think, since https is everywhere. Also some
 people use WWW and some don't :/

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


More information about the wp-trac mailing list