Bug Tracker

Modify

Ticket #2661 (closed bug: fixed)

Opened 6 years ago

Last modified 2 years ago

Browser detection IE (and possibly other browsers)

Reported by: cybernetix Owned by: flesler
Priority: major Milestone: 1.4
Component: core Version: 1.4a1
Keywords: browser detection Cc:
Blocking: Blocked by:

Description

If MEGAUPLOAD or similar plugin is installed jQuery.browser returns wrong IE version.

For example userAgent string for IE7 with installed MEGAUPLOAD plugin is:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; MEGAUPLOAD 2.0)

jQuery.browser.version returns 6 instead of 7

First plus (+) should be removed from regExp and than it will work fine. So, this line:

(userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ )
[])[1]

should read:

(userAgent.match( /.(?:rv|it|ra|ie)[\/: ]([\d.]+)/ )
[])[1]

Change History

comment:1 Changed 6 years ago by flesler

  • Owner set to flesler
  • Status changed from new to assigned

Same as #2784

comment:2 Changed 6 years ago by flesler

  • Milestone changed from 1.2.3 to 1.2.4

comment:3 Changed 6 years ago by eventualbudd

The solution you posted doesn't actually work with Opera. Here's one that passes all the jQuery tests (thanks Brad Greenlee!):

/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)(?!.+opera)/

comment:4 Changed 5 years ago by dmethvin

See also #3169 (dup but essentially agrees on the regexp)

comment:5 Changed 5 years ago by dmethvin

Tickets #3696, #3402, #2661, and #2413 are all related, but for different user-agents.

comment:6 Changed 5 years ago by mesoconcepts

comment:7 Changed 5 years ago by mesoconcepts

cross-referencing in case someone on the WP end submits a patch:

 http://trac.wordpress.org/ticket/8933#comment:5

comment:8 Changed 5 years ago by brandon

I've closed the following bugs as duplicates of this one to consolidate the conversations/fixes. When fixing this bug, please be sure that the fix addresses these other issues as well. #4338, #3696, #3402, #2413, #3169, #2748, and #1537

comment:9 Changed 5 years ago by dmethvin

Adding dup #4674 to the pile.

comment:10 Changed 5 years ago by dmethvin

Also dup #4722.

comment:11 Changed 5 years ago by dmethvin

Boop boop be dup #4754.

comment:12 Changed 5 years ago by dmethvin

See also #5279.

comment:13 Changed 5 years ago by dmethvin

See also #5127.

comment:16 Changed 4 years ago by john

  • Status changed from assigned to closed
  • Version changed from 1.2.3 to 1.4a1
  • Resolution set to fixed
  • Milestone changed from 1.2.4 to 1.4

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.