aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2013-11-27 21:23:32 -0800
committerCesar G <prototech91@gmail.com>2013-11-27 21:26:23 -0800
commit7da44904025fcdb2cac5555f08c72d4e5f97f1d1 (patch)
tree953cc03a9c59f7aebf17dcecf96294a8b24b2aaa /phpBB/includes
parentef2e5ca9669cabbb0153b4855ed19403a6079536 (diff)
downloadforums-7da44904025fcdb2cac5555f08c72d4e5f97f1d1.tar
forums-7da44904025fcdb2cac5555f08c72d4e5f97f1d1.tar.gz
forums-7da44904025fcdb2cac5555f08c72d4e5f97f1d1.tar.bz2
forums-7da44904025fcdb2cac5555f08c72d4e5f97f1d1.tar.xz
forums-7da44904025fcdb2cac5555f08c72d4e5f97f1d1.zip
[ticket/11507] Handle empty sets correctly.
Using the last parameter in $db->sql_in_set() does not give the correct behaviour expected here. The query should not be negated if the set is empty. PHPBB3-11507
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_prune.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 6860fa220d..78db1eff15 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -500,8 +500,8 @@ class acp_prune
WHERE ug.group_id = ' . (int) $group_id . '
AND ug.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER . '
- AND ug.user_pending = 0
- AND ' . $db->sql_in_set('ug.user_id', $user_ids, false, true) . '
+ AND ug.user_pending = 0 ' .
+ ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . '
AND u.user_id = ug.user_id';
$result = $db->sql_query($sql);
@@ -525,9 +525,9 @@ class acp_prune
{
$sql = 'SELECT u.user_id, u.username, COUNT(p.post_id) AS queue_posts
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
- WHERE ' . $db->sql_in_set('p.poster_id', $user_ids, false, true) . '
- AND u.user_id <> ' . ANONYMOUS . '
- AND u.user_type <> ' . USER_FOUNDER . '
+ WHERE u.user_id <> ' . ANONYMOUS . '
+ AND u.user_type <> ' . USER_FOUNDER .
+ ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
AND p.post_visibility = ' . ITEM_UNAPPROVED . '
AND u.user_id = p.poster_id
GROUP BY p.poster_id