From 23f7866c8f62744a9747efaef00b6981e084d244 Mon Sep 17 00:00:00 2001 From: Brent Hopkins Date: Thu, 18 May 2023 05:41:06 -0500 Subject: [PATCH] Increased security for getIP() function --- functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions.php b/functions.php index cc18fa72..dc27e3da 100644 --- a/functions.php +++ b/functions.php @@ -85,6 +85,9 @@ function getIP() { } else { $ip = $_SERVER["HTTP_CF_CONNECTING_IP"] ?? $_SERVER['REMOTE_ADDR']; } + + if (!filter_var($ip, FILTER_VALIDATE_IP)) + die("Potential Security Violation"); return $ip; }