mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Fix incorrect identification of DaumApps webview as robot
This commit is contained in:
parent
8379932dce
commit
c1942080e7
2 changed files with 3 additions and 1 deletions
|
|
@ -171,7 +171,7 @@ class UA
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for common search engine names and the 'bot' keyword.
|
// Look for common search engine names and the 'bot' keyword.
|
||||||
if (preg_match('/bot|spider|crawler|archiver|wget|curl|php|slurp|wordpress|facebook|external(agent|fetcher)|teoma|yeti|daum|apachebench|googleother|mediapartners-google|[(<+]https?:|@/i', $ua))
|
if (preg_match('/bot|spider|crawler|archiver|wget|curl|php|slurp|wordpress|facebook|external(agent|fetcher)|teoma|yeti|daum\b|apachebench|googleother|mediapartners-google|[(<+]https?:|@/i', $ua))
|
||||||
{
|
{
|
||||||
return self::$_robot_cache[$ua] = true;
|
return self::$_robot_cache[$ua] = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ class UATest extends \Codeception\Test\Unit
|
||||||
$this->assertTrue(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)'));
|
$this->assertTrue(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)'));
|
||||||
$this->assertTrue(Rhymix\Framework\UA::isRobot('Googlebot/2.1 (+http://www.googlebot.com/bot.html)'));
|
$this->assertTrue(Rhymix\Framework\UA::isRobot('Googlebot/2.1 (+http://www.googlebot.com/bot.html)'));
|
||||||
$this->assertTrue(Rhymix\Framework\UA::isRobot('Yeti/1.0 (NHN Corp.; http://help.naver.com/robots/)'));
|
$this->assertTrue(Rhymix\Framework\UA::isRobot('Yeti/1.0 (NHN Corp.; http://help.naver.com/robots/)'));
|
||||||
|
$this->assertTrue(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (compatible; MSIE or Firefox mutant; not on Windows server;) Daum 4.1'));
|
||||||
$this->assertTrue(Rhymix\Framework\UA::isRobot('Random user agent (+https://url.com)'));
|
$this->assertTrue(Rhymix\Framework\UA::isRobot('Random user agent (+https://url.com)'));
|
||||||
$this->assertTrue(Rhymix\Framework\UA::isRobot('facebookexternalhit/1.1'));
|
$this->assertTrue(Rhymix\Framework\UA::isRobot('facebookexternalhit/1.1'));
|
||||||
$this->assertTrue(Rhymix\Framework\UA::isRobot('meta-externalfetcher/1.1'));
|
$this->assertTrue(Rhymix\Framework\UA::isRobot('meta-externalfetcher/1.1'));
|
||||||
|
|
@ -49,6 +50,7 @@ class UATest extends \Codeception\Test\Unit
|
||||||
// Not robot
|
// Not robot
|
||||||
$this->assertFalse(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'));
|
$this->assertFalse(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'));
|
||||||
$this->assertFalse(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'));
|
$this->assertFalse(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'));
|
||||||
|
$this->assertFalse(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (Linux; Android 15; SM-XXX Build/AAAA; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/143.0.0.0 Mobile Safari/537.36 DaumApps/8.0.0 DaumDevice/mobile'));
|
||||||
$this->assertFalse(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko'));
|
$this->assertFalse(Rhymix\Framework\UA::isRobot('Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue