From a04db9bd0b05aef50acfdd906a0eecb2bbbb82b1 Mon Sep 17 00:00:00 2001 From: w3houde Date: Fri, 12 Jun 2026 00:07:07 +0200 Subject: [PATCH] Fix #34931 strip surrounding & from action=reconcile in bank delete link (#38708) The delete-icon link on bankentries_list.php stripped 'action=reconcile' from $param but left a stray trailing '&' (and the same string can be re-emitted by other includes), so the final URL ended up with two action= query params (action=delete and action=reconcile). PHP picks the last one, the page silently switches to the reconcile path and the delete confirm dialog never opens. Widen the preg_replace to consume the surrounding & as well, and also clean up the confirm_deleteonreconcile form. Signed-off-by: Dolicraft Co-authored-by: Dolicraft --- htdocs/compta/bank/bankentries_list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 50660a9261c..3a438675059 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1913,7 +1913,9 @@ if ($resql) { } } if ($user->hasRight('banque', 'modifier')) { - $parambis = preg_replace('/action=reconcile/', '', $param); + // Strip the surrounding & so the leading action= we put first stays the only action= in the URL. + // Without this the URL ends up with two action= params; PHP picks the last one and the page silently switches to 'reconcile' instead of 'delete'. + $parambis = preg_replace('/&?action=(reconcile|confirm_deleteonreconcile)(&|$)/', '\2', $param); print ''; print img_delete('', 'class="marginleftonly"'); print '';