Merge branch 'ent-4622-Fallo-filtrado-en-listado-acceso-API' into 'develop'

Fixed bug with API access list - #4622

See merge request artica/pandorafms!2724
This commit is contained in:
Alejandro Fraguas 2020-02-05 10:44:42 +01:00
commit ec98d861b2
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;
}
}
}
}