aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-08-09 17:43:28 +0200
committerMarc Alexander <admin@m-a-styles.de>2014-08-09 17:43:28 +0200
commit57d94b7bb42f5dd963156e28ecbb24d32967aa3f (patch)
treec00a491daa40027cc039faf6abd7140bd185bfdd /phpBB
parent0de1d65804ef8b68a189703b78381ed2787f6484 (diff)
downloadforums-57d94b7bb42f5dd963156e28ecbb24d32967aa3f.tar
forums-57d94b7bb42f5dd963156e28ecbb24d32967aa3f.tar.gz
forums-57d94b7bb42f5dd963156e28ecbb24d32967aa3f.tar.bz2
forums-57d94b7bb42f5dd963156e28ecbb24d32967aa3f.tar.xz
forums-57d94b7bb42f5dd963156e28ecbb24d32967aa3f.zip
[ticket/12742] Add sort options for notification types requiring sorting
PHPBB3-12742
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/phpbb/notification/type/base.php8
-rw-r--r--phpBB/phpbb/notification/type/post.php2
-rw-r--r--phpBB/phpbb/notification/type/quote.php2
3 files changed, 9 insertions, 3 deletions
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
index 895127f831..4ead06071e 100644
--- a/phpBB/phpbb/notification/type/base.php
+++ b/phpBB/phpbb/notification/type/base.php
@@ -540,9 +540,10 @@ abstract class base implements \phpbb\notification\type\type_interface
* @param array $users Array of users that have subscribed to a notification
* @param int $forum_id Forum ID of the forum
* @param array $options Array of notification options
+ * @param bool $sort Whether the users array should be sorted. Default: false
* @return array Array of users that are authorised recipients
*/
- protected function get_authorised_recipients($users, $forum_id, $options)
+ protected function get_authorised_recipients($users, $forum_id, $options, $sort = false)
{
if (empty($users))
{
@@ -551,6 +552,11 @@ abstract class base implements \phpbb\notification\type\type_interface
$users = array_unique($users);
+ if ($sort)
+ {
+ sort($users);
+ }
+
$auth_read = $this->auth->acl_get_list($users, 'f_read', $forum_id);
if (empty($auth_read))
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
index 1bd95bfbf6..1eba4a6a88 100644
--- a/phpBB/phpbb/notification/type/post.php
+++ b/phpBB/phpbb/notification/type/post.php
@@ -123,7 +123,7 @@ class post extends \phpbb\notification\type\base
}
$this->db->sql_freeresult($result);
- $notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options);
+ $notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options, true);
if (empty($notify_users))
{
diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php
index 42ec663bfc..5c3c822ec2 100644
--- a/phpBB/phpbb/notification/type/quote.php
+++ b/phpBB/phpbb/notification/type/quote.php
@@ -102,7 +102,7 @@ class quote extends \phpbb\notification\type\post
}
$this->db->sql_freeresult($result);
- return $this->get_authorised_recipients($users, $post['forum_id'], $options);
+ return $this->get_authorised_recipients($users, $post['forum_id'], $options, true);
}
/**