Improve regex for robot detection

- User-Agent에 URL이 들어갈 때는 괄호에 넣거나 +를 붙이도록 되어 있음
- 워드프레스 핑백 공격도 로봇으로 취급
This commit is contained in:
Kijin Sung 2018-06-14 14:18:27 +09:00
parent ca90ac2c8e
commit b6557622d2

View file

@ -146,7 +146,7 @@ class UA
}
// Look for common search engine names and the 'bot' keyword.
if (preg_match('/bot|spider|crawler|archiver|wget|curl|php|slurp|facebook|teoma|yeti|daum|https?:|@/i', $ua))
if (preg_match('/bot|spider|crawler|archiver|wget|curl|php|slurp|wordpress|facebook|teoma|yeti|daum|[(<+]https?:|@/i', $ua))
{
return self::$_robot_cache[$ua] = true;
}