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
if (isset($_SESSION['domain']["cidr"]) && !defined('STDIN')) {
$found = false;
foreach($_SESSION['domain']["cidr"] as $cidr) {
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
$found = true;
break;
if (!empty($_SESSION['domain']["cidr"])) {
foreach($_SESSION['domain']["cidr"] as $cidr) {
if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
$found = true;
break;
}
}
unset($cidr);
}
if (!$found) {
echo "access denied";