From 3424914d8bcd56599bf5efe49dac96beb1df3a78 Mon Sep 17 00:00:00 2001 From: w3houde Date: Thu, 11 Jun 2026 09:31:41 +0200 Subject: [PATCH] Fix #35103 require confirm='yes' before deleting in confirm_delete (#38687) 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 Co-authored-by: Dolicraft --- htdocs/core/actions_addupdatedelete.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 5405ed230e9..ea876c0e545 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -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;