diff --git a/phpBB/index.php b/phpBB/index.php index 32bc118e8c..6927705f91 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -63,7 +63,7 @@ if (($mark_notification = $request->variable('mark_notification', 0))) redirect(append_sid($phpbb_root_path . $redirect)); } - redirect($notification->get_url()); + redirect($notification->get_redirect_url()); } } } diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index 0719540bdb..7d08521d40 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -275,6 +275,14 @@ abstract class base implements \phpbb\notification\type\type_interface return $this->mark(true, $return); } + /** + * {inheritDoc} + */ + public function get_redirect_url() + { + return $this->get_url(); + } + /** * Prepare to output the notification to the template * diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index f973becc3b..7d4bc06879 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -269,6 +269,14 @@ class post extends \phpbb\notification\type\base return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "p={$this->item_id}#p{$this->item_id}"); } + /** + * {inheritDoc} + */ + public function get_redirect_url() + { + return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "t={$this->item_parent_id}&view=unread#unread"); + } + /** * Users needed to query before this notification can be displayed * diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php index e3e6898172..2f465aae2b 100644 --- a/phpBB/phpbb/notification/type/type_interface.php +++ b/phpBB/phpbb/notification/type/type_interface.php @@ -98,6 +98,13 @@ interface type_interface */ public function get_url(); + /** + * Get the url to redirect after the item has been marked as read + * + * @return string URL + */ + public function get_redirect_url(); + /** * URL to unsubscribe to this notification *