Changeset 398056
- Timestamp:
- 06/16/2011 05:50:26 PM (15 years ago)
- Location:
- browser-sniff/trunk
- Files:
-
- 2 edited
-
browsersniff.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
browser-sniff/trunk/browsersniff.php
r285365 r398056 826 826 } elseif (preg_match('/iPhone/i', $ua) || preg_match('/iPad/i', $ua) || preg_match('/iPod/i', $ua) ) { 827 827 list($os_name, $os_code, $os_ver) = pri_detect_apple_device($ua); 828 } elseif (preg_match(' /Mac OS X/i', $ua)) {829 $os_name = "Mac OS ";830 $os_code = "macos"; 831 $os_ver = "X";828 } elseif (preg_match('#Mac OS X ([a-zA-Z0-9_]+)#i', $ua, $matches)) { 829 $os_name = "Mac OS X"; 830 $os_code = "macos"; 831 $os_ver = str_replace('_','.',$matches[1]);; 832 832 } elseif (preg_match('/Macintosh/i', $ua)) { 833 833 $os_name = "Mac OS"; … … 916 916 elseif (preg_match('#iPod#i', $ua )) { 917 917 $os_ver = ""; 918 $os_name = "i Pod";918 $os_name = "iOS"; 919 919 $os_code = "macos"; 920 920 } 921 921 elseif (preg_match('#iPhone OS ([a-zA-Z0-9_]+)#i', $ua, $matches)) { 922 922 $os_ver = str_replace('_','.',$matches[1]); 923 $os_name = "i PhoneOS";923 $os_name = "iOS"; 924 924 $os_code = "macos"; 925 925 } 926 926 elseif (preg_match('#iPhone#i', $ua )) { 927 927 $os_ver = ""; 928 $os_name = "i Phone";928 $os_name = "iOS"; 929 929 $os_code = "macos"; 930 930 } 931 931 elseif (preg_match('#iPad#i', $ua ) && preg_match('#OS ([a-zA-Z0-9_]+)#i', $ua, $matches)) { 932 932 $os_ver = str_replace('_','.',$matches[1]); 933 $os_name = "i Pad";933 $os_name = "iOS"; 934 934 $os_code = "macos"; 935 935 } 936 936 elseif (preg_match('#iPad#i', $ua )) { 937 937 $os_ver = ""; 938 $os_name = "i Pad";938 $os_name = "iOS"; 939 939 $os_code = "macos"; 940 940 } -
browser-sniff/trunk/readme.txt
r277310 r398056 4 4 Tags: browser, operating system, browser sniff 5 5 Requires at least: 1.5.0 6 Tested up to: 3. 0.17 Stable tag: 2. 16 Tested up to: 3.1.3 7 Stable tag: 2.2 8 8 9 9 Detects web browser type and operating system to show in the comment loop … … 119 119 * Changed iPod/iPhone OS to iOS 120 120 121 = 2.2 = 122 * Changed all Apple devices OS to iOS 123 * Changed Mac OS X detection to show version 124 121 125 == Upgrade Notice == 126 127 = 2.2 = 128 Changed Apple device detection and compatibility of the plugin up to 3.1.3 122 129 123 130 = 2.1 = … … 151 158 The default use of the plugin show something like this: 152 159 153 ** Using Mozilla Firefox Mozilla Firefox 3.6.3 on Windows Windows XP**160 ** Using Mozilla Firefox Mozilla Firefox 4.0 on Windows Windows 7 ** 154 161 155 162 If there's no recorded user agent string(WP1.5-), strings before and after will no be printed.
Note: See TracChangeset
for help on using the changeset viewer.