[ticket/9690] Add forthcoming Bing Bot to list of recognized bots

Microsoft will rename MSN Bot to Bing Bot later this year, and change its user agent.  This updates phpBB to be aware of Bing Bot

PHPBB3-9690
This commit is contained in:
Josh Woody 2010-07-03 22:12:25 -05:00
parent b7ae0fe4e9
commit d00f2ec183
2 changed files with 53 additions and 0 deletions

View file

@ -1685,6 +1685,58 @@ function change_database_data(&$no_updates, $version)
$db->sql_freeresult($result); $db->sql_freeresult($result);
// add Bing Bot
$sql = 'SELECT group_id, group_colour
FROM ' . GROUPS_TABLE . "
WHERE group_name = 'BOTS'";
$result = $db->sql_query($sql);
$group_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$group_row)
{
// default fallback, should never get here
$group_row['group_id'] = 6;
$group_row['group_colour'] = '9E8DA7';
}
if (!function_exists('user_add'))
{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
$bot_name = 'Bing [Bot]';
$bot_agent = 'bingbot/';
$bot_ip = '';
$user_row = array(
'user_type' => USER_IGNORE,
'group_id' => $group_row['group_id'],
'username' => $bot_name,
'user_regdate' => time(),
'user_password' => '',
'user_colour' => $group_row['group_colour'],
'user_email' => '',
'user_lang' => $config['default_lang'],
'user_style' => $config['default_style'],
'user_timezone' => 0,
'user_dateformat' => $config['default_dateformat'],
'user_allow_massemail' => 0,
);
$user_id = user_add($user_row);
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'bot_active' => 1,
'bot_name' => (string) $bot_name,
'user_id' => (int) $user_id,
'bot_agent' => (string) $bot_agent,
'bot_ip' => (string) $bot_ip,
));
_sql($sql, $errored, $error_ary);
// end Bing Bot addition
$no_updates = false; $no_updates = false;
break; break;
} }

View file

@ -2108,6 +2108,7 @@ class install_install extends module
'Alta Vista [Bot]' => array('Scooter/', ''), 'Alta Vista [Bot]' => array('Scooter/', ''),
'Ask Jeeves [Bot]' => array('Ask Jeeves', ''), 'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
'Baidu [Spider]' => array('Baiduspider+(', ''), 'Baidu [Spider]' => array('Baiduspider+(', ''),
'Bing [Bot]' => array('bingbot/', ''),
'Exabot [Bot]' => array('Exabot/', ''), 'Exabot [Bot]' => array('Exabot/', ''),
'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''), 'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''), 'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),