From 8405f0d324fd42bec2f775986e69e5d8cf548ebf Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 12 Aug 2006 13:14:39 +0000 Subject: sql_in_set changes git-svn-id: file:///svn/phpbb/trunk@6271 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_prune.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'phpBB/includes/acp/acp_prune.php') diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 3fa99b6727..4752e7bafe 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -68,7 +68,7 @@ class acp_prune 'S_PRUNED' => true) ); - $sql_forum = (sizeof($forum_id)) ? ' AND forum_id IN (' . implode(', ', $forum_id) . ')' : ''; + $sql_forum = (sizeof($forum_id)) ? ' AND ' . $db->sql_in_set('forum_id', $forum_id) : ''; // Get a list of forum's or the data for the forum that we are pruning. $sql = 'SELECT forum_id, forum_name @@ -148,7 +148,7 @@ class acp_prune { $sql = 'SELECT forum_id, forum_name FROM ' . FORUMS_TABLE . ' - WHERE forum_id IN (' . implode(', ', $forum_id) . ')'; + WHERE ' . $db->sql_in_set('forum_id', $forum_id); $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); @@ -202,15 +202,7 @@ class acp_prune if ($users) { - $users = explode("\n", $users); - - $where_sql = ''; - - foreach ($users as $username) - { - $where_sql .= (($where_sql != '') ? ', ' : '') . "'" . $db->sql_escape($username) . "'"; - } - $where_sql = " AND username IN ($where_sql)"; + $where_sql = ' AND ' . $db->sql_in_set('username', explode("\n", $users)); } else { -- cgit v1.2.1