Fix module type validadion on api set create network module

This commit is contained in:
Calvo 2022-10-27 15:18:15 +02:00
parent 0f82209d7e
commit 8a43421b49
1 changed files with 13 additions and 0 deletions

View File

@ -3587,6 +3587,19 @@ function api_set_create_network_module($id, $thrash1, $other, $thrash3)
// Column 'module_macros' cannot be null.
}
$type_exist = db_get_value_filter(
'id_tipo',
'ttipo_modulo',
[
'id_tipo' => $values['id_tipo_modulo'],
]
);
if ((bool) $type_exist === false) {
returnError('Module type does not exist');
return;
}
if ($agent_by_alias) {
$agents_affected = 0;
$idModule = false;