Plugin Directory

Changeset 398056


Ignore:
Timestamp:
06/16/2011 05:50:26 PM (15 years ago)
Author:
bpedrassani
Message:

Changed Apple OS to iOS and the Mac OSX detection

Location:
browser-sniff/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • browser-sniff/trunk/browsersniff.php

    r285365 r398056  
    826826    } elseif (preg_match('/iPhone/i', $ua) || preg_match('/iPad/i', $ua) || preg_match('/iPod/i', $ua) ) {
    827827        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]);;
    832832    } elseif (preg_match('/Macintosh/i', $ua)) {
    833833        $os_name = "Mac OS";
     
    916916    elseif (preg_match('#iPod#i', $ua )) {
    917917        $os_ver = "";
    918         $os_name = "iPod";
     918        $os_name = "iOS";
    919919        $os_code = "macos";
    920920    }
    921921    elseif (preg_match('#iPhone OS ([a-zA-Z0-9_]+)#i', $ua, $matches)) {
    922922        $os_ver = str_replace('_','.',$matches[1]);
    923         $os_name = "iPhone OS";
     923        $os_name = "iOS";
    924924        $os_code = "macos";
    925925    }
    926926    elseif (preg_match('#iPhone#i', $ua )) {
    927927        $os_ver = "";
    928         $os_name = "iPhone";
     928        $os_name = "iOS";
    929929        $os_code = "macos";
    930930    }
    931931    elseif (preg_match('#iPad#i', $ua ) && preg_match('#OS ([a-zA-Z0-9_]+)#i', $ua, $matches)) {
    932932        $os_ver = str_replace('_','.',$matches[1]);
    933         $os_name = "iPad";
     933        $os_name = "iOS";
    934934        $os_code = "macos";
    935935    }
    936936    elseif (preg_match('#iPad#i', $ua )) {
    937937        $os_ver = "";
    938         $os_name = "iPad";
     938        $os_name = "iOS";
    939939        $os_code = "macos";
    940940    }
  • browser-sniff/trunk/readme.txt

    r277310 r398056  
    44Tags: browser, operating system, browser sniff
    55Requires at least: 1.5.0
    6 Tested up to: 3.0.1
    7 Stable tag: 2.1
     6Tested up to: 3.1.3
     7Stable tag: 2.2
    88
    99Detects web browser type and operating system to show in the comment loop
     
    119119* Changed iPod/iPhone OS to iOS
    120120
     121= 2.2 =
     122* Changed all Apple devices OS to iOS
     123* Changed Mac OS X detection to show version
     124
    121125== Upgrade Notice ==
     126
     127= 2.2 =
     128Changed Apple device detection and compatibility of the plugin up to 3.1.3
    122129
    123130= 2.1 =
     
    151158The default use of the plugin show something like this:
    152159
    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 **
    154161
    155162If 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.