From 69fa9874dd2a05e83225220fd46aa0a425f32aa3 Mon Sep 17 00:00:00 2001 From: WaLLy3K Date: Thu, 18 May 2017 18:54:26 +1000 Subject: [PATCH] Use HTTP_HOST instead of SERVER_NAME * Fixes https://github.com/pi-hole/pi-hole/issues/1479 --- advanced/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/advanced/index.php b/advanced/index.php index 89c49051..a5545ea4 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -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 } -// Validate SERVER_NAME output -if (validate_server_name($_SERVER["SERVER_NAME"]) === TRUE) { - $serverName = $_SERVER["SERVER_NAME"]; +// Validate HTTP_HOST output +if (validate_server_name($_SERVER["HTTP_HOST"]) === TRUE) { + $serverName = $_SERVER["HTTP_HOST"]; } else { - die("[ERROR]: SERVER_NAME header output does not appear to be valid: ".$_SERVER["SERVER_NAME"].""); + die("[ERROR]: HTTP_HOST header output does not appear to be valid: ".$_SERVER["HTTP_HOST"].""); } // Get values from setupVars.conf