Bug Tracker

Opened 15 years ago

Closed 13 years ago

Last modified 11 years ago

#2661 closed bug (fixed)

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:
Blocked by: Blocking:

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 (16)

comment:1 Changed 15 years ago by flesler

Owner: set to flesler
Status: newassigned

Same as #2784

comment:2 Changed 15 years ago by flesler

Milestone: 1.2.31.2.4

comment:3 Changed 15 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 14 years ago by dmethvin

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

comment:5 Changed 14 years ago by dmethvin

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

comment:7 Changed 14 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 14 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 14 years ago by dmethvin

Adding dup #4674 to the pile.

comment:10 Changed 14 years ago by dmethvin

Also dup #4722.

comment:11 Changed 14 years ago by dmethvin

Boop boop be dup #4754.

comment:12 Changed 14 years ago by dmethvin

See also #5279.

comment:13 Changed 14 years ago by dmethvin

See also #5127.

comment:16 Changed 13 years ago by john

Milestone: 1.2.41.4
Resolution: fixed
Status: assignedclosed
Version: 1.2.31.4a1
Note: See TracTickets for help on using tickets.