mirror of
https://github.com/itflow-org/itflow
synced 2026-03-20 12:44:50 +00:00
Increased security for getIP() function
This commit is contained in:
@@ -85,6 +85,9 @@ function getIP() {
|
|||||||
} else {
|
} else {
|
||||||
$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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user