Fixed bug with API access list - #4622

This commit is contained in:
Tatiana Llorente 2019-09-12 14:13:42 +02:00
parent a56d5dcad5
commit 515521cd00
1 changed files with 7 additions and 2 deletions

View File

@ -301,8 +301,13 @@ function isInACL($ip)
// example lab.artica.es without '*'
$name = [];
$name = gethostbyname($acl_ip);
if (preg_match('/'.$name.'/', $ip)) {
return true;
if (preg_match('/'.$name.'/', $ip, $matches)) {
// This is for false matches, like '' or $.
if (count($matches) == 1 && $matches[0] == '') {
continue;
} else {
return true;
}
}
}
}