mirror of
https://github.com/kokororin/typecho-plugin-Access.git
synced 2025-01-01 07:50:29 +08:00
commit
f47b294cda
@ -135,16 +135,17 @@ class Access_Parser
|
||||
$ua = $this->filter($ua);
|
||||
if (!empty($ua)) {
|
||||
foreach ($this->bots as $val) {
|
||||
if (($val == 'Bot' || $val == 'Spider')
|
||||
&& (preg_match('#([a-zA-Z0-9]+(bot|spider))[ /]*([0-9.]*)#i', $ua, $matches))) {
|
||||
$this->currentBot = $matches[1] . ' ' . $matches[3];
|
||||
return true;
|
||||
}
|
||||
$str = $this->filter($val);
|
||||
if (strpos($ua, $str) !== false) {
|
||||
$this->currentBot = $str;
|
||||
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