PHP says that arrays cannot be used as keys, protect against this case as reported that some keys are arrays!

This commit is contained in:
Ermal 2011-06-15 16:57:18 +00:00
parent f45075dd98
commit 1540194f7d

View File

@ -1241,8 +1241,12 @@ function captiveportal_write_db($cpdb, $locked = false, $remove = false) {
if (is_array($remove)) {
if (!empty($remove)) {
$cpdb = captiveportal_read_db(true);
foreach ($remove as $key)
unset($cpdb[$key]);
foreach ($remove as $key) {
if (is_array($key))
log_error("Captive portal Array passed as unset index: " . print_r($key, true));
else
unset($cpdb[$key]);
}
} else
return; //This makes sure no record removal calls
}