mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-02 13:40:16 +00:00
Remove external ipv6 brackets if any in servername
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
This commit is contained in:
parent
ddbdb51d20
commit
048e5bb9a2
1 changed files with 2 additions and 0 deletions
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
// Sanitise HTTP_HOST output
|
// Sanitise HTTP_HOST output
|
||||||
$serverName = htmlspecialchars($_SERVER["HTTP_HOST"]);
|
$serverName = htmlspecialchars($_SERVER["HTTP_HOST"]);
|
||||||
|
// Remove external ipv6 brackets if any
|
||||||
|
$serverName = preg_replace('/^\[(.*)\]$/', '${1}', $serverName);
|
||||||
|
|
||||||
if (!is_file("/etc/pihole/setupVars.conf"))
|
if (!is_file("/etc/pihole/setupVars.conf"))
|
||||||
die("[ERROR] File not found: <code>/etc/pihole/setupVars.conf</code>");
|
die("[ERROR] File not found: <code>/etc/pihole/setupVars.conf</code>");
|
||||||
|
|
Loading…
Add table
Reference in a new issue