Changes between Initial Version and Version 1 of Ticket #37945
- Timestamp:
- 09/05/2016 11:48:17 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37945 – Description
initial v1 1 In some WordPress server setups the $_SERVER['SERVER_NAME'] may not have been setup, so $_SERVER['SERVER_NAME']is empty.1 In some WordPress server setups the `$_SERVER['SERVER_NAME']` may not have been setup, so `$_SERVER['SERVER_NAME']` is empty. 2 2 3 3 For example Nginx (see http://nginx.org/en/docs/http/server_names.html) will set the server name to empty if none is set in the configuration, but afaik it is also possible for Apache to set the ServerName to an empty string. … … 5 5 If the from_email address is *also* NOT set this will cause PHPMailer to throw an exception complaining about an invalid address. This will cause an infamous white screen. 6 6 7 In https://core.trac.wordpress.org/ticket/32702 this was also mentioned but @boonebgorges thought the test was to blame and fixed the test, but IMHO the test was correct and the code should be fixed.7 In #32702 this was also mentioned but @boonebgorges thought the test was to blame and fixed the test, but IMHO the test was correct and the code should be fixed. 8 8 9 9 We need to check if the SERVER_NAME is empty or not. I've attached a patch in which I check to make sure SERVER_NAME is not empty and if it is empty it will resort to using the admin_email address instead. At least this mail address should be valid, although it might still fail to deliver the email sent due to using a different domain than the server WordPress is installed on. 10 10 11 A much better option might be to allow the user to choose the from email address, but apparently this has been considered and at that moment considered a bad idea, see https://core.trac.wordpress.org/ticket/2336511 A much better option might be to allow the user to choose the from email address, but apparently this has been considered and at that moment considered a bad idea, see #23365.