diff --git a/README.md b/README.md index 3ac156a..c0f7e70 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,5 @@ Currently Detected Browsers - Chrome - Opera - Silk -- Lynx \ No newline at end of file +- Lynx +- Wget \ No newline at end of file diff --git a/Source/UserAgentParser.php b/Source/UserAgentParser.php index 00b3bcc..57e2f08 100644 --- a/Source/UserAgentParser.php +++ b/Source/UserAgentParser.php @@ -15,8 +15,8 @@ function parse_user_agent( $u_agent = null ) { if( preg_match('/\((.*?)\)/im', $u_agent, $regs) ) { - # (?Android|iPhone|iPad|Windows|Linux|Macintosh|Windows Phone OS|Silk)(?: NT)?(?:[ /][0-9._]+)*(;|$) - preg_match_all('%(?PAndroid|iPhone|iPad|Windows|Linux|Macintosh|Windows Phone OS|Silk)(?: NT)?(?:[ /][0-9._]+)*(;|$)%im', $regs[1], $result, PREG_PATTERN_ORDER); + # (?Android|iPhone|iPad|Windows|Linux|Macintosh|Windows Phone OS|Silk|linux-gnu)(?: NT)?(?:[ /][0-9._]+)*(;|$) + preg_match_all('%(?PAndroid|iPhone|iPad|Windows|Linux|Macintosh|Windows Phone OS|Silk|linux-gnu)(?: NT)?(?:[ /][0-9._]+)*(;|$)%im', $regs[1], $result, PREG_PATTERN_ORDER); $result['platform'] = array_unique($result['platform']); if( count($result['platform']) > 1 ) { if( ($key = array_search( 'Android', $result['platform'] )) !== false ) { @@ -28,8 +28,9 @@ function parse_user_agent( $u_agent = null ) { } - # (?Camino|Kindle|Firefox|Safari|MSIE|AppleWebKit|Chrome|IEMobile|Opera|Silk|Lynx|Version)(?:[/ ])(?[0-9.]+) - preg_match_all('%(?PCamino|Kindle|Firefox|Safari|MSIE|AppleWebKit|Chrome|IEMobile|Opera|Silk|Lynx|Version)(?:[/ ])(?P[0-9.]+)%im', $u_agent, $result, PREG_PATTERN_ORDER); + # (?Camino|Kindle|Firefox|Safari|MSIE|AppleWebKit|Chrome|IEMobile|Opera|Silk|Lynx|Version|Wget)(?:[/ ])(?[0-9.]+) + preg_match_all('%(?PCamino|Kindle|Firefox|Safari|MSIE|AppleWebKit|Chrome|IEMobile|Opera|Silk|Lynx|Version|Wget)(?:[/ ])(?P[0-9.]+)%im', $u_agent, $result, PREG_PATTERN_ORDER); + //print_r( $result ); diff --git a/index.php b/index.php index 91d8faa..2f79271 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,7 @@ //Old School Yo 'Lynx/2.8.6rel.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7l Lynxlet/0.7.0' => array('platform' => '', 'browser' => 'Lynx', 'version' => '2.8.6'), - +'Wget/1.12 (linux-gnu)' => array('platform' => 'linux-gnu','browser' => 'Wget', 'version' => '1.12'), 'Mozilla/4.0 (Windows; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)' => array('platform' => 'Windows', 'browser' => 'MSIE', 'version' => '6.0'), 'Mozilla/4.0 (MSIE 6.0; Windows NT 5.1)' => array('platform' => 'Windows', 'browser' => 'MSIE', 'version' => '6.0'),