Skip to main content

Bug Tracker

Side navigation

#2784 closed bug (duplicate)

Opened May 04, 2008 12:23AM UTC

Closed March 18, 2009 03:05AM UTC

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:
Description

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)
Change History (7)

Changed May 06, 2008 02:45AM UTC by flesler comment:1

owner: → 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.

Changed May 06, 2008 03:01AM UTC by flesler comment:2

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

Changed May 06, 2008 03:27AM UTC by flesler comment:3

Same as #2661

Changed May 14, 2008 08:29PM UTC by flesler comment:4

milestone: 1.2.31.2.4

Changed July 02, 2008 09:37PM UTC by bgreenlee comment:5

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 July 02, 2008 10:22PM UTC by flesler comment:6

milestone: 1.2.41.3
need: ReviewPatch

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

Changed March 18, 2009 03:05AM UTC by brandon comment:7

resolution: → duplicate
status: assignedclosed

duplicate of #2661