mirror of
https://github.com/pi-hole/web.git
synced 2025-12-27 05:56:22 +00:00
Correctly parse IPV4_ADDRESS in setupVars for CORS
Often there's a `/24` at the end of the IP, so we need to ignore that.
This commit is contained in:
@@ -16,7 +16,7 @@ function log_and_die($message) {
|
||||
|
||||
function check_cors() {
|
||||
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
|
||||
$ipv4 = isset($setupVars["IPV4_ADDRESS"]) ? $setupVars["IPV4_ADDRESS"] : $_SERVER['SERVER_ADDR'];
|
||||
$ipv4 = isset($setupVars["IPV4_ADDRESS"]) ? explode("/", $setupVars["IPV4_ADDRESS"])[0] : $_SERVER['SERVER_ADDR'];
|
||||
|
||||
// Check CORS
|
||||
$AUTHORIZED_HOSTNAMES = array(
|
||||
|
||||
Reference in New Issue
Block a user