Merge pull request #3439 from RMcGirr83/ticket/13587

[ticket/13587] SQL syntax errors in get_prune_users()
This commit is contained in:
Joas Schilling 2015-02-24 20:44:15 +01:00
commit 56cbff720d

View file

@ -507,7 +507,7 @@ class acp_prune
AND ug.user_id <> ' . ANONYMOUS . ' AND ug.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER . ' AND u.user_type <> ' . USER_FOUNDER . '
AND ug.user_pending = 0 ' . AND ug.user_pending = 0 ' .
((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . ' ((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . '
AND u.user_id = ug.user_id'; AND u.user_id = ug.user_id';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -533,7 +533,7 @@ class acp_prune
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE u.user_id <> ' . ANONYMOUS . ' WHERE u.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER . AND u.user_type <> ' . USER_FOUNDER .
((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . ' ((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . ' AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
AND u.user_id = p.poster_id AND u.user_id = p.poster_id
GROUP BY p.poster_id GROUP BY p.poster_id