Bug Tracker

Modify

Ticket #1867 (closed bug: duplicate)

Opened 6 years ago

Last modified 15 months ago

Some MS IE 7.0 userAgent strings return a jQuery browser.version of 6.0

Reported by: danielnashnz Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

I am not sure how I got it (probably from the numerous .NET patches I have installed?) but my IE 7.0 userAgent string is returned as this:

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)

Which because of the greedy match in the jQuery ver 1.2.1 browser version assignement:

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

returns a version number of "6.0" from the second "MSIE \d..." string.

I have searched around on the Web and there seem to quite a few userAgents logged with similarly confounding identifiers.

Change History

comment:1 Changed 6 years ago by achun

ya

I try fix it;

jQuery.browser = {
	version: (userAgent.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],//fixed by achun
	safari: /webkit/.test( userAgent ),
	opera: /opera/.test( userAgent ),
	msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
	mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ),
	firefox: /firefox/.test(userAgent),//fixed by achun
	is:(userAgent.match(/.*(opera|msie|firefox|mozilla)/) || [])[1]//fixed by achun
};

if ('firefox'==jQuery.browser.is) {//fixed by achun
	jQuery.browser.version = (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1];
}

comment:2 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

This is a duplicate of #2784 but I left the later ticket open since it had more activity.

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.