mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Use HTTP_HOST instead of SERVER_NAME
* Fixes https://github.com/pi-hole/pi-hole/issues/1479
This commit is contained in:
parent
f9d41caeb6
commit
69fa9874dd
@ -15,11 +15,11 @@ function validate_server_name($domain) { // Cr: http://stackoverflow.com/a/46948
|
|||||||
&& preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain)); // Length of each label
|
&& preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain)); // Length of each label
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate SERVER_NAME output
|
// Validate HTTP_HOST output
|
||||||
if (validate_server_name($_SERVER["SERVER_NAME"]) === TRUE) {
|
if (validate_server_name($_SERVER["HTTP_HOST"]) === TRUE) {
|
||||||
$serverName = $_SERVER["SERVER_NAME"];
|
$serverName = $_SERVER["HTTP_HOST"];
|
||||||
} else {
|
} else {
|
||||||
die("[ERROR]: <code>SERVER_NAME</code> header output does not appear to be valid: <code>".$_SERVER["SERVER_NAME"]."</code>");
|
die("[ERROR]: <code>HTTP_HOST</code> header output does not appear to be valid: <code>".$_SERVER["HTTP_HOST"]."</code>");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get values from setupVars.conf
|
// Get values from setupVars.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user