Ticket #416: 416.diff
File 416.diff, 1.5 KB (added by , 11 years ago) |
---|
-
parse.php
18 18 if ( preg_match('/^.+?(?P<platform>Android|iPhone|iPad|Windows|Linux|Macintosh|Windows Phone OS|RIM Tablet OS|PlayBook)(?: NT)*(?: [ix]?[0-9._]+)*(;|\))/im', $user_agent, $regs ) ) 19 19 $data['platform'] = $regs['platform']; 20 20 21 preg_match_all( '%(?P<name> Camino|Kindle|Firefox|(?:Mobile )?Safari|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Opera|Version)(?:[/ ])(?P<version>[0-9.]+)%im', $user_agent, $result, PREG_PATTERN_ORDER );21 preg_match_all( '%(?P<name>Trident|Camino|Kindle|Firefox|(?:Mobile )?Safari|MSIE|RockMelt|AppleWebKit|Chrome|IEMobile|Opera|Version)(?:[/ ])(?P<version>[0-9.]+)%im', $user_agent, $result, PREG_PATTERN_ORDER ); 22 22 23 23 // If Version/x.x.x was specified in UA string store it and ignore it 24 24 if ( $key = array_search( 'Version', $result['name'] ) ) { … … 57 57 $key = 0; 58 58 } 59 59 $data['version'] = $result['version'][ $key ]; 60 } else { 60 } elseif ( 'Trident' == $result['name'][0] ) { 61 // IE 11 and beyond have switched to Trident 62 // http://msdn.microsoft.com/en-us/library/ie/hh869301%28v=vs.85%29.aspx 63 $data['name'] = 'Internet Explorer'; 64 if( '7.0' == $result['version'][0] ) { 65 $data['version'] = '11'; 66 } 67 } else { 61 68 $data['name'] = $result['name'][0]; 62 69 $data['version'] = $result['version'][0]; 63 70 }