From 05b573ebf76c737f89deaefd22ce963aa910e5d1 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 15 Sep 2012 13:51:02 -0500 Subject: [ticket/11103] Topic and post dis/approval notifications Remove the formatted title function, plaintext is not needed since email templates are used Fix a number of bugs. PHPBB3-11103 --- phpBB/includes/notifications/service.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/notifications/service.php') diff --git a/phpBB/includes/notifications/service.php b/phpBB/includes/notifications/service.php index 7fdba5e48a..6e7b160e0f 100644 --- a/phpBB/includes/notifications/service.php +++ b/phpBB/includes/notifications/service.php @@ -69,7 +69,10 @@ class phpbb_notifications_service // Anonymous users and bots never receive notifications if ($options['user_id'] == $user->data['user_id'] && ($user->data['user_id'] == ANONYMOUS || $user->data['user_type'] == USER_IGNORE)) { - return; + return array( + 'notifications' => array(), + 'unread_count' => 0, + ); } $notifications = $user_ids = array(); @@ -273,8 +276,8 @@ class phpbb_notifications_service $notification_objects = $notification_methods = array(); $new_rows = array(); - // Never send notifications to the anonymous user or the current user! - unset($notify_users[ANONYMOUS], $notify_users[$this->phpbb_container->get('user')->data['user_id']]); + // Never send notifications to the anonymous user! + unset($notify_users[ANONYMOUS]); // Make sure not to send new notifications to users who've already been notified about this item // This may happen when an item was added, but now new users are able to see the item @@ -457,7 +460,7 @@ class phpbb_notifications_service { if (!$safe) { - $item_type = preg_replace('#[^a-z]#', '', $item_type); + $item_type = preg_replace('#[^a-z_]#', '', $item_type); } return 'phpbb_notifications_type_' . $item_type; -- cgit v1.2.1