aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-11-09 12:53:33 +0100
committerAndreas Fischer <bantu@phpbb.com>2012-11-09 12:53:33 +0100
commit54700f5ba24fe944616e017c3c2ff9c09c312445 (patch)
tree478ad2a51248c39faeaf91afb21e4582fdcedde7 /phpBB/install/database_update.php
parent520ffdf368bee84549a0b284bd2df4da1d633a8f (diff)
downloadforums-54700f5ba24fe944616e017c3c2ff9c09c312445.tar
forums-54700f5ba24fe944616e017c3c2ff9c09c312445.tar.gz
forums-54700f5ba24fe944616e017c3c2ff9c09c312445.tar.bz2
forums-54700f5ba24fe944616e017c3c2ff9c09c312445.tar.xz
forums-54700f5ba24fe944616e017c3c2ff9c09c312445.zip
[ticket/10897] Use same code/query for deleting.
PHPBB3-10897
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index bd12a90288..b8bf85e283 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2164,21 +2164,18 @@ function change_database_data(&$no_updates, $version)
foreach ($bots_to_delete as $bot_name)
{
- $bot_name_clean = utf8_clean_string($bot_name);
-
$sql = 'SELECT user_id
- FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'";
+ FROM ' . USERS_TABLE . '
+ WHERE user_type = ' . USER_IGNORE . "
+ AND username_clean = '" . $db->sql_escape(utf8_clean_string($bot_name)) . "'";
$result = $db->sql_query($sql);
- $bot_user_id = $db->sql_fetchfield('user_id');
- $is_user = (bool) $bot_user_id;
+ $bot_user_id = (int) $db->sql_fetchfield('user_id');
$db->sql_freeresult($result);
- if ($is_user)
+ if ($bot_user_id)
{
$sql = 'DELETE FROM ' . BOTS_TABLE . "
- WHERE bot_name = '" . $db->sql_escape($bot_name) . "'";
-
+ WHERE user_id = $bot_user_id";
_sql($sql, $errored, $error_ary);
user_delete('remove', $bot_user_id);