mirror of
https://github.com/kokororin/typecho-plugin-Access.git
synced 2025-01-17 07:40:21 +08:00
增加自动识别未知爬虫的功能
This commit is contained in:
parent
9a4889cf1d
commit
65836755d5
@ -51,6 +51,8 @@ class Access_Parser
|
||||
'crawler',
|
||||
'bingbot',
|
||||
'YisouSpider',
|
||||
'Bot',
|
||||
'Spider',
|
||||
);
|
||||
|
||||
protected $currentBot = null;
|
||||
@ -139,6 +141,10 @@ class Access_Parser
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (preg_match('#([a-zA-Z0-9]+(bot|spider))[ /]*([0-9.]*)#i', $ua, $matches)) {
|
||||
$this->currentBot = $matches[1] . $matches[2];
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user