mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Merge pull request #1397 from pi-hole/fix/ipv4ipv6error
Bugfix: Blocking page
This commit is contained in:
commit
fbb6b56d99
1 changed files with 7 additions and 2 deletions
|
@ -19,10 +19,15 @@ $uriExt = pathinfo($uri, PATHINFO_EXTENSION);
|
|||
// Define which URL extensions get rendered as "Website Blocked"
|
||||
$webExt = array('asp', 'htm', 'html', 'php', 'rss', 'xml');
|
||||
|
||||
// Get IPv4 and IPv6 addresses from setupVars.conf (if available)
|
||||
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
|
||||
$ipv4 = isset($setupVars["IPV4_ADDRESS"]) ? explode("/", $setupVars["IPV4_ADDRESS"])[0] : $_SERVER['SERVER_ADDR'];
|
||||
$ipv6 = isset($setupVars["IPV6_ADDRESS"]) ? explode("/", $setupVars["IPV6_ADDRESS"])[0] : $_SERVER['SERVER_ADDR'];
|
||||
|
||||
$AUTHORIZED_HOSTNAMES = array(
|
||||
$ipv4,
|
||||
$ipv6,
|
||||
str_replace(array("[","]"), array("",""), $_SERVER["SERVER_NAME"]),
|
||||
str_replace(array("[","]"), array("",""), $_SERVER["SERVER_ADDR"]),
|
||||
"pi.hole",
|
||||
"localhost");
|
||||
// Allow user set virtual hostnames
|
||||
|
|
Loading…
Reference in a new issue