From 7f58a4572eaca75aecff2da889e67ea151616011 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 28 Oct 2013 22:27:25 +0100 Subject: [ticket/11981] Fix code sniffer complaints PHPBB3-11981 --- phpBB/includes/ucp/ucp_notifications.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/includes/ucp/ucp_notifications.php') diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index 145963837c..dd62b69342 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -78,9 +78,9 @@ class ucp_notifications trigger_error($message); } - $this->output_notification_methods('notification_methods', $phpbb_notifications, $template, $user); + $this->output_notification_methods($phpbb_notifications, $template, $user, 'notification_methods'); - $this->output_notification_types($subscriptions, 'notification_types', $phpbb_notifications, $template, $user); + $this->output_notification_types($subscriptions, $phpbb_notifications, $template, $user, 'notification_types'); $this->tpl_name = 'ucp_notifications'; $this->page_title = 'UCP_NOTIFICATION_OPTIONS'; @@ -162,12 +162,12 @@ class ucp_notifications /** * Output all the notification types to the template * - * @param string $block * @param \phpbb\notification\manager $phpbb_notifications * @param \phpbb\template\template $template * @param \phpbb\user $user + * @param string $block */ - public function output_notification_types($subscriptions, $block = 'notification_types', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user) + public function output_notification_types($subscriptions, \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_types') { $notification_methods = $phpbb_notifications->get_subscription_methods(); @@ -209,12 +209,12 @@ class ucp_notifications /** * Output all the notification methods to the template * - * @param string $block * @param \phpbb\notification\manager $phpbb_notifications * @param \phpbb\template\template $template * @param \phpbb\user $user + * @param string $block */ - public function output_notification_methods($block = 'notification_methods', \phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user) + public function output_notification_methods(\phpbb\notification\manager $phpbb_notifications, \phpbb\template\template $template, \phpbb\user $user, $block = 'notification_methods') { $notification_methods = $phpbb_notifications->get_subscription_methods(); -- cgit v1.2.1 From 54b7b2320c33023a85f4b11ded778491d63b73bd Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 2 Nov 2013 10:42:16 +0100 Subject: [ticket/11983] Add missing argument to docblock in ucp_notifications The argument $subscriptions was not documented in the docblock of the method output_notification_types() until now. PHPBB3-11983 --- phpBB/includes/ucp/ucp_notifications.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/ucp/ucp_notifications.php') diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index dd62b69342..5a896c31b0 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -162,6 +162,7 @@ class ucp_notifications /** * Output all the notification types to the template * + * @param array $subscriptions Array containing global subscriptions * @param \phpbb\notification\manager $phpbb_notifications * @param \phpbb\template\template $template * @param \phpbb\user $user -- cgit v1.2.1 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/ucp/ucp_notifications.php') 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/ucp/ucp_notifications.php') 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