diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-03-22 18:14:13 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-03-22 18:14:13 +0100 |
commit | 57eb50812f138296085b51b74079037c2efe1c43 (patch) | |
tree | d81cc2f2eef1ed7095d2c8ca803e269c230b912a /phpBB/includes/functions_privmsgs.php | |
parent | 1337f861235436efa3ca21ad7cd35d28849bde18 (diff) | |
parent | 5a9dd1994fc20aaebe3145540b630826d7333998 (diff) | |
download | forums-57eb50812f138296085b51b74079037c2efe1c43.tar forums-57eb50812f138296085b51b74079037c2efe1c43.tar.gz forums-57eb50812f138296085b51b74079037c2efe1c43.tar.bz2 forums-57eb50812f138296085b51b74079037c2efe1c43.tar.xz forums-57eb50812f138296085b51b74079037c2efe1c43.zip |
Merge remote-tracking branch 'rxu/ticket/10684' into develop-olympus
* rxu/ticket/10684:
[ticket/10684] Adjust function and parameter name, minor changes.
[ticket/10684] Rename function phpbb_get_banned_users_ids() parameter
[ticket/10684] Remove intval mapping for array keys
[ticket/10684] Adjust pm_notifications() to handle stale bans
[ticket/10684] Cast user_id to integer
[ticket/10684] Refactor $sql_ignore_users array update
[ticket/10684] Remove isset() for $sql_ignore_users update
[ticket/10684] Fix 2 typos in comment lines.
[ticket/10684] Send notifications for users with stale bans
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r-- | phpBB/includes/functions_privmsgs.php | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index c40ceb088f..447920cfd5 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1622,6 +1622,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $subject = censor_text($subject); + // Exclude guests, current user and banned users from notifications unset($recipients[ANONYMOUS], $recipients[$user->data['user_id']]); if (!sizeof($recipients)) @@ -1629,18 +1630,12 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i return; } - // Get banned User ID's - $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ' . $db->sql_in_set('ban_userid', array_map('intval', array_keys($recipients))) . ' - AND ban_exclude = 0'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) + if (!function_exists('phpbb_get_banned_user_ids')) { - unset($recipients[$row['ban_userid']]); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $db->sql_freeresult($result); + $banned_users = phpbb_get_banned_user_ids(array_keys($recipients)); + $recipients = array_diff(array_keys($recipients), $banned_users); if (!sizeof($recipients)) { @@ -1649,7 +1644,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients))); + WHERE ' . $db->sql_in_set('user_id', $recipients); $result = $db->sql_query($sql); $msg_list_ary = array(); |