WordPress.org

Making WordPress.org


Ignore:
Timestamp:
06/20/2014 12:07:02 AM (6 years ago)
Author:
Otto42
Message:

Add support for IE-11/Trident. props blobaugh, fixes #416

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/browse-happy/1.0/parse.php

    r1 r717  
    1919        $data['platform'] = $regs['platform'];
    2020
    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 );
    2222   
    2323    // If Version/x.x.x was specified in UA string store it and ignore it
     
    5858        }
    5959        $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 {
    6168        $data['name'] = $result['name'][0];
    6269        $data['version'] = $result['version'][0];
Note: See TracChangeset for help on using the changeset viewer.