WordPress.org

Make WordPress Core

Ticket #14537: 14537.5.patch

File 14537.5.patch, 946 bytes (added by hakre, 8 years ago)

Preserves $is_IE, Fixes #14954, has filter, seperates concerns.

  • wp-includes/vars.php

     
    4040if ( isset($_SERVER['HTTP_USER_AGENT']) ) {
    4141        if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx') !== false ) {
    4242                $is_lynx = true;
    43         } elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false ) {
     43        } elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) === false ) {
    4444                $is_chrome = true;
    4545        } elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false ) {
    4646                $is_safari = true;
     
    6262
    6363$is_IE = ( $is_macIE || $is_winIE );
    6464
     65// Google Chrome Frame Support
     66if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) && apply_filters( 'use_google_chrome_frame', is_admin() ) )
     67                header('X-UA-Compatible: chrome=1');
     68
    6569// Server detection
    6670
    6771/**