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 comment:1
owner: | → flesler |
---|---|
status: | new → assigned |
Changed May 06, 2008 03:01AM UTC by 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 14, 2008 08:29PM UTC by comment:4
milestone: | 1.2.3 → 1.2.4 |
---|
Changed July 02, 2008 09:37PM UTC by 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 comment:6
milestone: | 1.2.4 → 1.3 |
---|---|
need: | Review → Patch |
Ok, will do some testing, will surely be fixed for 1.3.
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.