mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-23 11:35:24 +02:00
Merge branch 'ticket/nickvergessen/9888' into develop-olympus
* ticket/nickvergessen/9888: [ticket/9888] Update fails when Bing [Bot] was already added to the users table
This commit is contained in:
@ -1729,6 +1729,20 @@ function change_database_data(&$no_updates, $version)
|
|||||||
_sql($sql, $errored, $error_ary);
|
_sql($sql, $errored, $error_ary);
|
||||||
|
|
||||||
// add Bing Bot
|
// add Bing Bot
|
||||||
|
$bot_name = 'Bing [Bot]';
|
||||||
|
$bot_name_clean = utf8_clean_string($bot_name);
|
||||||
|
|
||||||
|
$sql = 'SELECT user_id
|
||||||
|
FROM ' . USERS_TABLE . "
|
||||||
|
WHERE username_clean = '" . $db->sql_escape($bot_name_clean) . "'";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$bing_already_added = (bool) $db->sql_fetchfield('user_id');
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
if (!$bing_already_added)
|
||||||
|
{
|
||||||
|
$bot_agent = 'bingbot/';
|
||||||
|
$bot_ip = '';
|
||||||
$sql = 'SELECT group_id, group_colour
|
$sql = 'SELECT group_id, group_colour
|
||||||
FROM ' . GROUPS_TABLE . "
|
FROM ' . GROUPS_TABLE . "
|
||||||
WHERE group_name = 'BOTS'";
|
WHERE group_name = 'BOTS'";
|
||||||
@ -1748,10 +1762,6 @@ function change_database_data(&$no_updates, $version)
|
|||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
}
|
}
|
||||||
|
|
||||||
$bot_name = 'Bing [Bot]';
|
|
||||||
$bot_agent = 'bingbot/';
|
|
||||||
$bot_ip = '';
|
|
||||||
|
|
||||||
$user_row = array(
|
$user_row = array(
|
||||||
'user_type' => USER_IGNORE,
|
'user_type' => USER_IGNORE,
|
||||||
'group_id' => $group_row['group_id'],
|
'group_id' => $group_row['group_id'],
|
||||||
@ -1778,6 +1788,7 @@ function change_database_data(&$no_updates, $version)
|
|||||||
));
|
));
|
||||||
|
|
||||||
_sql($sql, $errored, $error_ary);
|
_sql($sql, $errored, $error_ary);
|
||||||
|
}
|
||||||
// end Bing Bot addition
|
// end Bing Bot addition
|
||||||
|
|
||||||
// Delete shadow topics pointing to not existing topics
|
// Delete shadow topics pointing to not existing topics
|
||||||
|
Reference in New Issue
Block a user