Move validation functions into func.php and use the same validation in all cases.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2021-07-25 16:45:05 +02:00
parent 690feb8b26
commit 03920e3595
6 changed files with 75 additions and 78 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ header('Content-type: application/json');
require("scripts/pi-hole/php/database.php");
require("scripts/pi-hole/php/password.php");
require("scripts/pi-hole/php/auth.php");
require("scripts/pi-hole/php/func.php");
check_cors();
// Set maximum execution time to 10 minutes
@@ -31,7 +32,7 @@ function resolveHostname($clientip, $printIP)
return $clientname;
}
else if(filter_var($clientip, FILTER_VALIDATE_IP))
else if(validIP($clientip))
{
// Get host name of client and convert to lower case
$clientname = strtolower(gethostbyaddr($ipaddr));