From c64edcb15cfd986281cee11fc997c8a8dc33642b Mon Sep 17 00:00:00 2001 From: mattago93 Date: Fri, 20 Nov 2026 16:14:58 +0100 Subject: [PATCH] [3.0] Compare saved document hashes when detecting rollbacks Use the hash of the newly submitted agreement or privacy policy to recognize a rollback instead of reading an uninitialized EditDiff. Fixes #9854 Signed-off-by: Mattia Agostini --- Sources/Actions/Admin/Registration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Actions/Admin/Registration.php b/Sources/Actions/Admin/Registration.php index d98b905ec6..1b4dd93178 100644 --- a/Sources/Actions/Admin/Registration.php +++ b/Sources/Actions/Admin/Registration.php @@ -303,7 +303,7 @@ public function agreement(): void // If no one else has accepted the current version, we can // simplify the history a bit. if (empty($num_accepted)) { - if ($edit_history[1][1] === $diff->label1) { + if ($edit_history[1][1] === hash('crc32c', $_POST['agreement'])) { // The admin is simply undoing the last change. $rollback = true; } else { @@ -489,7 +489,7 @@ public function privacyPolicy(): void // If no one else has accepted the current version, we can // simplify the history a bit. if (empty($num_accepted)) { - if (isset($edit_history[1]) && $edit_history[1][1] === $diff->label1) { + if (isset($edit_history[1]) && $edit_history[1][1] === hash('crc32c', $_POST['policy'])) { // The admin is simply undoing the last change. $rollback = true; } else {