Bug Tracker

Ticket #2661 (assigned bug)

Opened 5 months ago

Last modified 2 months ago

Browser detection IE (and possibly other browsers)

Reported by: cybernetix Assigned to: flesler (accepted)
Type: bug Priority: major
Milestone: 1.2.4 Component: core
Version: 1.2.3 Keywords: browser detection
Cc: Needs: Review

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]

Attachments

Change History

Changed 4 months ago by flesler

  • status changed from new to assigned
  • owner set to flesler

Same as #2784

Changed 4 months ago by flesler

  • milestone changed from 1.2.3 to 1.2.4

Changed 2 months ago by eventualbuddha

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)/
Note: See TracTickets for help on using tickets.