Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

useragent strings that contain multiple "Windows NT" versions are not handled properly #38

Closed
mcvella opened this Issue · 1 comment

2 participants

@mcvella

Some useragent strings contain more than one "Windows NT" version.

For example (this is an actual useragent string):

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; Zune 4.0; .NET CLR 1.

Note that there is present both "Windows NT 6.1" and "Windows NT 5.1".

Currently, the useragent module reports this the OS for this as "Windows XP", when in fact it should be "Windows 7".

The fix here is to order the "Windows NT" regexes so that Windows versions are searched for in order from highest version to lowest version (since only the highest "Windows NT" string should be regarded).

I'll open a pull request for this now.

@fq-dev fq-dev referenced this issue from a commit in fq-dev/useragent
@fq-dev fq-dev issue #38 : proper search order for Windows NT strings 773e213
@3rd-Eden
Owner

Closing this, all changes and regexp updates should be made against regexp database that we use, not this module.

( https://github.com/tobie/ua-parser/blob/master/regexes.yaml )

@3rd-Eden 3rd-Eden closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.