From 048e5bb9a2bbad4fdf603e9d124b1db5e53a4d44 Mon Sep 17 00:00:00 2001 From: Patrik Cyvoct Date: Wed, 22 Aug 2018 09:11:55 +0200 Subject: [PATCH] Remove external ipv6 brackets if any in servername Signed-off-by: Patrik Cyvoct --- advanced/index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/advanced/index.php b/advanced/index.php index cad59ec7..f104bcf6 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -8,6 +8,8 @@ // Sanitise HTTP_HOST output $serverName = htmlspecialchars($_SERVER["HTTP_HOST"]); +// Remove external ipv6 brackets if any +$serverName = preg_replace('/^\[(.*)\]$/', '${1}', $serverName); if (!is_file("/etc/pihole/setupVars.conf")) die("[ERROR] File not found: /etc/pihole/setupVars.conf");