From 1dd25ce62df7650a295cdf017148a89962a538c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= Date: Thu, 3 Feb 2011 14:56:31 +0100 Subject: [PATCH] [ticket/9581] Make banlist table select optional Per Nick, only set the `BANLIST_TABLE` in the select statement if the `$sql_ban_where` variable is set. PHPBB3-9581 --- phpBB/includes/acp/acp_email.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index d65cce7899..c81a64d2a0 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -85,7 +85,7 @@ class acp_email if ($group_id) { $sql = 'SELECT u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type - FROM ' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + FROM ' . ((!empty($sql_ban_where)) ? BANLIST_TABLE . ' b, ' : '') . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug WHERE ug.group_id = ' . $group_id . ' AND ug.user_pending = 0 AND u.user_id = ug.user_id @@ -97,7 +97,7 @@ class acp_email else { $sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_jabber, u.user_notify_type, u.user_lang - FROM (' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u) + FROM (' . ((!empty($sql_ban_where)) ? BANLIST_TABLE . ' b, ' : '') . USERS_TABLE . ' u) WHERE u.user_allow_massemail = 1 AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ") {$sql_ban_where}