Bug Tracker

Opened 15 years ago

Closed 14 years ago

#2784 closed bug (duplicate)

In IE7 version is reported as 6.0

Reported by: cgriffin Owned by: flesler
Priority: minor Milestone: 1.3
Component: core Version: 1.2.3
Keywords: IE7 version Cc:
Blocked by: Blocking:


IE7 is reporting the following in userAgent:

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; InfoPath.1; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)

The current RegEx for extracting the version is: /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ I believe the first .+ is greedy and therefore passing the MSIE 7.0 in favor of the later MSIE 6.0.

Adding a question mark after the .+ negates the greedyness of that expression.

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

Attachments (1)

browser_version_regex_fix.diff (1.9 KB) - added by bgreenlee 15 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 15 years ago by flesler

Owner: set to flesler
Status: newassigned

Ok tested this, my user agent is nothing like that... but assuming yours has an IE6 inside, then the ? will do. These needs to be tested, to see it doesn't break for other browsers.

comment:2 Changed 15 years ago by flesler

It's odd, for Firefox and Safari, the revisions are collected, and not the versions. I wonder if this is the desired information, I'll have to ask around.

You can check the results with and without your modification: original: http://flesler.webs.com/UA/ modified: http://flesler.webs.com/UA/modified.html

comment:3 Changed 15 years ago by flesler

Same as #2661

comment:4 Changed 15 years ago by flesler


comment:5 Changed 15 years ago by bgreenlee

I just ran into the same problem. The regex suggested by the OP does not pass all tests, however (it breaks a couple of the Opera tests). Attached is a diff that includes a regex that does pass.

Changed 15 years ago by bgreenlee

comment:6 Changed 15 years ago by flesler

need: ReviewPatch

Ok, will do some testing, will surely be fixed for 1.3.

comment:7 Changed 14 years ago by brandon

Resolution: duplicate
Status: assignedclosed

duplicate of #2661

Note: See TracTickets for help on using tickets.