FIX avoid "Undefined array key" warning

This commit is contained in:
Regis Houssin 2025-01-13 14:24:17 +01:00
parent 188070729a
commit e5a6f5f9ce

View File

@ -58,13 +58,13 @@ if ($action == 'update' && !empty($arrayofparameters) && is_array($arrayofparame
foreach ($arrayofparameters as $key => $val) {
// Modify constant only if key was posted (avoid resetting key to the null value)
if (GETPOSTISSET($key)) {
if (!empty($val['type']) && preg_match('/category:/', $val['type'])) {
if (isset($val['type']) && preg_match('/category:/', $val['type'])) {
if (GETPOSTINT($key) == '-1') {
$val_const = '';
} else {
$val_const = GETPOSTINT($key);
}
} elseif ($val['type'] == 'html') {
} elseif (isset($val['type']) && $val['type'] == 'html') {
$val_const = GETPOST($key, 'restricthtml');
} else {
$val_const = GETPOST($key, 'alpha');