Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows() method incorrectly identifies NT 5.2 #94

Open
wjhendr opened this issue Feb 12, 2015 · 3 comments
Open

windows() method incorrectly identifies NT 5.2 #94

wjhendr opened this issue Feb 12, 2015 · 3 comments

Comments

@wjhendr
Copy link

wjhendr commented Feb 12, 2015

Hello,

I'm using version 1.75 of the module.

Using the following UA string:

Mozilla/5.0 (Windows NT 5.2; WOW64; rev:26.0) Gecko/20100101 Firefox/26.0

where i believe the relevant portion is "NT 5.2", i was informed that:

$browser->win2k3() = 1
$browser->winxp() = 0

however, the user agent system is actually Windows XP Pro x64 Build 3790 (SP2).

According to Wikipedia's "List of Microsoft Windows versions", both
Windows Server 2003 and Windows XP Pro x64 have the Release version
number "NT 5.2".

http://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions

I don't have a solution, but i just wanted to point out this
discrepancy, in case you didn't already know about it.

Perhaps in the case of 5.2, both win2k3() and winxp() should return true? I don't have access to a win2k3 box, so I can't test this further.

@dougwilson
Copy link
Collaborator

The reason it's confused is because of the history of the x64 Windows XP operating systems. Unline the 32-bit version of Windows XP, the x64 editions actually use the same kernel and code tree as Windows Server 2003 and is serviced by the same service pack (see https://en.wikipedia.org/wiki/Windows_XP_Professional_x64_Edition).

You will see virtually every other UA detector make this same assertion. Windows NT 5.1 is Windows XP and Windows NT 5.2 is Windows Server 2003. Windows XP Pro x64 identifies itself as NT 5.2 instead of 5.1 because of the reasons Wikipedia notes.

There is no way to fix this in this module unless we want all Windows 2003 servers to suddenly be detected as Windows XP.

@wjhendr
Copy link
Author

wjhendr commented Feb 15, 2015

There is no way to fix this in this module unless we want all Windows 2003 servers to suddenly be detected as Windows XP.

yes, every other one i tried does the same thing. i just decided to kick in my feedback to this one b/c i liked it the most. i agree there is no way, based on the UA, to reliably distinguish the one from the other. i did not recommend to make all win2k3 boxes be detected as winxp, though. i just thought maybe the authors would consider something like "win2k/winxp" as an (optional) OS tag. esp considering there are probably more winxp boxes being misdiagnosed than win2k boxes...i was never holding my breath, though.

@dougwilson
Copy link
Collaborator

Well, it comes down to the reason for the detection. For instance, you have a driver download page that needs to distinguish between Windows XP (NT 5.1) and Windows Server 2003 (NT 5.2). A user is using this module to distinguish these two and direct the user to the proper driver to download. Clearly this use-case needs to continue to work.

Can you describe your use-case of needing to detect the operating system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants