Fixed error message "Invalid argument supplied for foreach()" and "in_array() expects parameter 2 to be array"

This commit is contained in:
Jose Gonzalez 2020-09-07 12:58:09 +02:00
parent 5093d94db3
commit e3e7f3b313
1 changed files with 4 additions and 0 deletions

View File

@ -267,6 +267,10 @@ function isInACL($ip)
{ {
global $config; global $config;
if (! is_array($config['list_ACL_IPs_for_API'])) {
$config['list_ACL_IPs_for_API'] = explode(';', $config['list_ACL_IPs_for_API']);
}
if (in_array($ip, $config['list_ACL_IPs_for_API'])) { if (in_array($ip, $config['list_ACL_IPs_for_API'])) {
return true; return true;
} }