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: |
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 (8)
comment:1 Changed 15 years ago by
Owner: | set to flesler |
---|---|
Status: | new → assigned |
comment:2 Changed 15 years ago by
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:4 Changed 15 years ago by
Milestone: | 1.2.3 → 1.2.4 |
---|
comment:5 Changed 15 years ago by
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
Attachment: | browser_version_regex_fix.diff added |
---|
comment:6 Changed 15 years ago by
Milestone: | 1.2.4 → 1.3 |
---|---|
need: | Review → Patch |
Ok, will do some testing, will surely be fixed for 1.3.
comment:7 Changed 14 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
duplicate of #2661
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.