[wp-trac] [WordPress Trac] #50532: Undefined index SERVER_NAME
WordPress Trac
noreply at wordpress.org
Thu Jul 2 10:00:59 UTC 2020
#50532: Undefined index SERVER_NAME
--------------------------+-----------------------------
Reporter: malthert | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
wp-includes/pluggable.php
{{{#!php
<?php
$sitename = strtolower( $_SERVER['SERVER_NAME'] );
}}}
1) this requires an !empty check to avoid a notice
2) I suggest to change this to HTTP_HOST as this is more commonly correct
(if not set) than SERVER_NAME (maybe fallback to SERVER_NAME)
3) this must be properly sanitized
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50532>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list