Plugin Directory

Changeset 671841


Ignore:
Timestamp:
02/22/2013 06:14:42 PM (13 years ago)
Author:
jblz
Message:

Jetpack: Notifications: Discontinue support for Internet Explorer versions 7 and below.
fixes #1660

Location:
jetpack/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/modules/notes.php

    r640733 r671841  
    7070    }
    7171
     72    // return the major version of Internet Explorer the viewer is using or false if it's not IE
     73    public static function get_internet_explorer_version() {
     74        static $version;
     75        if ( isset( $version ) ) {
     76            return $version;
     77        }
     78
     79        preg_match( '/MSIE (\d+)/', $_SERVER['HTTP_USER_AGENT'], $matches );
     80        $version = empty( $matches[1] ) ? null : $matches[1];
     81        if ( empty( $version ) || !$version ) {
     82            return false;
     83        }
     84        return $version;
     85    }
     86
     87    public static function current_browser_is_supported() {
     88        static $supported;
     89
     90        if ( isset( $supported ) ) {
     91            return $supported;
     92        }
     93
     94        $ie_version = self::get_internet_explorer_version();
     95        if ( false === $ie_version ) {
     96            return $supported = true;
     97        }
     98
     99        if ( $ie_version < 8 ) {
     100            return $supported = false;
     101        }
     102
     103        return $supported = true;
     104    }
     105
    72106    function action_init() {
     107        if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
     108            return;
     109       
    73110        if ( !has_filter( 'show_admin_bar', '__return_true' ) && !is_user_logged_in() )
    74111            return;
     112
     113        if ( !self::current_browser_is_supported() )
     114            return;
     115
    75116        add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu'), 120 );
    76117        add_action( 'wp_head', array( &$this, 'styles_and_scripts'), 120 );
  • jetpack/trunk/readme.txt

    r669962 r671841  
    9898* Enhancement: Sharedaddy: Allow selecting multiple images from a post using the Pinterest share button.
    9999* Enhancement: Contact Form: Allow feedbacks to be marked spam in bulk.
     100* Note: Notifications: Discontinue support for Internet Explorer 7 and below.
    100101* Bug Fix: JSON API: Fix authorization problems that some users were experiencing.
    101102* Bug Fix: Stats: sync stats_options so server has roles array needed for view_stats cap check.
Note: See TracChangeset for help on using the changeset viewer.