The shared confirm_delete branch at htdocs/core/actions_addupdatedelete.inc.php:468 fired on action=confirm_delete with permission, but never checked the $confirm value. Every other confirm_* branch in the same file checks $confirm == 'yes'. As a result, a card.php using the standard $form->formconfirm() flow without the ajax handler would delete the object when the user clicks 'No' on the confirmation dialog. Align with the rest of the file by requiring $confirm == 'yes'. Signed-off-by: Dolicraft <contact@dolicraft.com> Co-authored-by: Dolicraft <contact@dolicraft.com>
This commit is contained in:
parent
bc3c96401e
commit
3424914d8b
1 changed files with 1 additions and 1 deletions
|
|
@ -465,7 +465,7 @@ if ($action == "update_extras" && GETPOSTINT('id') > 0 && !empty($permissiontoed
|
|||
}
|
||||
|
||||
// Action to delete
|
||||
if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && !empty($permissiontodelete)) {
|
||||
if (!($object->id > 0)) {
|
||||
dol_print_error(null, 'Error, object must be fetched before being deleted');
|
||||
exit;
|
||||
|
|
|
|||
Loading…
Reference in a new issue