mirror of https://github.com/itflow-org/itflow
Merge pull request #686 from bhopkins0/patch-2
Security enchancement for getIP() function
This commit is contained in:
commit
0abc6b384c
|
|
@ -86,6 +86,9 @@ function getIP() {
|
||||||
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!filter_var($ip, FILTER_VALIDATE_IP))
|
||||||
|
die("Potential Security Violation");
|
||||||
|
|
||||||
return $ip;
|
return $ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue