From 5f3e231d13ff36e02f7acde6e515d7a50bc3e92b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Dec 2022 14:26:33 +0100 Subject: [PATCH] Fix delete of member --- htdocs/adherents/card.php | 3 ++- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 1c564aa9bf0..56e7868ec5a 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -620,7 +620,8 @@ if (empty($reshook)) { if ($user->hasRight('adherent', 'supprimer') && $action == 'confirm_delete' && $confirm == 'yes') { $result = $object->delete($id, $user); if ($result > 0) { - if (!empty($backtopage)) { + setEventMessages($langs->trans("RecordDeleted"), null, 'errors'); + if (!empty($backtopage) && !preg_match('/'.preg_quote($_SERVER["PHP_SELF"], '/').'/', $backtopage)) { header("Location: ".$backtopage); exit; } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 5b4923b7cd2..2a9acfc82e2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4999,7 +4999,7 @@ class Form { global $langs, $conf; - $more = ''; + $more = ''; $formconfirm = ''; $inputok = array(); $inputko = array();