Bug fixed unset the cidr variable

This commit is contained in:
FusionPBX 2023-06-03 10:19:42 -06:00 committed by GitHub
parent 079d9ca3d5
commit bc43f696ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -27,11 +27,14 @@
//check the domain cidr range //check the domain cidr range
if (isset($_SESSION['domain']["cidr"]) && !defined('STDIN')) { if (isset($_SESSION['domain']["cidr"]) && !defined('STDIN')) {
$found = false; $found = false;
foreach($_SESSION['domain']["cidr"] as $cidr) { if (!empty($_SESSION['domain']["cidr"])) {
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) { foreach($_SESSION['domain']["cidr"] as $cidr) {
$found = true; if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
break; $found = true;
break;
}
} }
unset($cidr);
} }
if (!$found) { if (!$found) {
echo "access denied"; echo "access denied";