From 252b5fe4f717494adde6644f257a044a661d2a7b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 9 Nov 2013 20:28:24 +0100 Subject: =?UTF-8?q?[=C5=A7icket/11896]=20Set=20form=5Ftime=20with=20time()?= =?UTF-8?q?=20when=20marking=20all=20notifications=20read?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit form_time is only set if is passed via the form. Since the mark notifications read link does not use the form, it will default to 0 causing the mark notifications logic to only mark notifications read if their time is smaller or equal to 0. This patch will change ucp_notifications to correctly set form_time for the confirm_box. PHPBB3-11896 --- phpBB/includes/ucp/ucp_notifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 5a896c31b0..de9352a322 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -103,7 +103,7 @@ class ucp_notifications { confirm_box(false, 'NOTIFICATIONS_MARK_ALL_READ', build_hidden_fields(array( 'mark' => 'all', - 'form_time' => $form_time, + 'form_time' => time(), ))); } } -- cgit v1.2.1 From 0d3396487e58091053778c9eb40ebcb6fa86536f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 14 Nov 2013 18:16:29 +0100 Subject: [ticket/11896] Use $form_time and fix out of bounds $form_time PHPBB3-11896 --- phpBB/includes/ucp/ucp_notifications.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index de9352a322..63dbe79666 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -27,7 +27,8 @@ class ucp_notifications add_form_key('ucp_notification'); $start = $request->variable('start', 0); - $form_time = min($request->variable('form_time', 0), time()); + $form_time = $request->variable('form_time', 0); + $form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time; $phpbb_notifications = $phpbb_container->get('notification_manager'); @@ -103,7 +104,7 @@ class ucp_notifications { confirm_box(false, 'NOTIFICATIONS_MARK_ALL_READ', build_hidden_fields(array( 'mark' => 'all', - 'form_time' => time(), + 'form_time' => $form_time, ))); } } -- cgit v1.2.1