Update core classes to refer to UA class for robot detection

This commit is contained in:
Kijin Sung 2016-03-19 23:32:35 +09:00
parent f1441613a2
commit 37bce0343d
5 changed files with 17 additions and 93 deletions

View file

@ -999,8 +999,7 @@ function json_encode2($data)
*/
function isCrawler($agent = NULL)
{
$agent = $agent ?: $_SERVER['HTTP_USER_AGENT'];
return (bool)preg_match('@bot|crawl|sp[iy]der|https?://|google|yahoo|slurp|yeti|daum|teoma|fish|hanrss|facebook|yandex|infoseek|askjeeves|stackrambler@i', $agent);
return Rhymix\Framework\UA::isRobot($agent);
}
/**