[wp-meta] [Making WordPress.org] #2587: Update browse-happy

Making WordPress.org noreply at wordpress.org
Fri Jul 21 12:55:54 UTC 2017


#2587: Update browse-happy
------------------------------+-----------------------
 Reporter:  azaozz            |       Owner:  Otto42
     Type:  defect            |      Status:  accepted
 Priority:  high              |   Milestone:
Component:  API               |  Resolution:
 Keywords:  has-patch commit  |
------------------------------+-----------------------

Comment (by tomdxw):

 I had a look at the patch, and I noticed one issue.

 IE9 is marked as `insecure`, but it's not marked as `upgrade`:

 {{{
 % php -r '$_SERVER["HTTP_USER_AGENT"]="Mozilla/5.0 (compatible; MSIE 9.0;
 Windows NT 6.1; Trident/5.0)";require("test.php");'
 Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1;
 Trident/5.0)<br/><br/>platform = Windows<br/>name = Internet
 Explorer<br/>version = 9.0<br/>update_url =
 http://www.microsoft.com/windows/internet-explorer/<br/>img_src =
 http://s.wordpress.org/images/browsers/ie.png<br/>img_src_ssl =
 https://wordpress.org/images/browsers/ie.png<br/>current_version =
 9<br/>upgrade = 0<br/>insecure = 1<br/>
 }}}

 But in WordPress, if `upgrade` is set to `0`, then it won't produce any
 warning, even if `insecure` is set to `1` (`wp-
 admin/includes/dashboard.php` line 29):

 {{{
         $response = wp_check_browser_version();

         if ( $response && $response['upgrade'] ) {
                 add_filter(
 'postbox_classes_dashboard_dashboard_browser_nag',
 'dashboard_browser_nag_class' );
                 if ( $response['insecure'] )
                         wp_add_dashboard_widget( 'dashboard_browser_nag',
 __( 'You are using an insecure browser!' ), 'wp_dashboard_browser_nag' );
                 else
                         wp_add_dashboard_widget( 'dashboard_browser_nag',
 __( 'Your browser is out of date!' ), 'wp_dashboard_browser_nag' );
         }
 }}}

 We just need to change `9` to `11` here, and it will produce the correct
 output:

 {{{
 function get_browser_current_versions() {
         return array(
                 'Chrome'            => '18', // Lowest version at the
 moment (mobile)
                 'Firefox'           => '16',
                 'Opera'             => '12.11',
                 'Safari'            => '5',
                 'Internet Explorer' => '9', // Left at 9 until Windows 7
 adopts 10
         );
 }
 }}}

--
Ticket URL: <https://meta.trac.wordpress.org/ticket/2587#comment:5>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list