]> granicus.if.org Git - php/commitdiff
Patches #67739
authorChristian Wenz <christian@wenz.org>
Fri, 1 Aug 2014 20:38:18 +0000 (22:38 +0200)
committerChristian Wenz <christian@wenz.org>
Fri, 1 Aug 2014 20:38:18 +0000 (22:38 +0200)
Fixes #67739: Windows 8.1/Server 2012 R2 OS build number reported as 6.2 (instead of 6.3)

ext/standard/info.c

index 12e36b4f1518aad70890b0020bc85cfbe5e72def..0d06037f815ab2c124e8d9c4947fbf031fbf3253 100644 (file)
@@ -592,6 +592,14 @@ PHPAPI char *php_get_uname(char mode)
 
                php_get_windows_cpu(wincpu, sizeof(wincpu));
                dwBuild = (DWORD)(HIWORD(dwVersion));
+               
+               /* Windows "version" 6.2 could be Windows 8/Windows Server 2012, but also Windows 8.1/Windows Server 2012 R2 */
+               if (dwWindowsMajorVersion == 6 && dwWindowsMinorVersion == 2) {
+                       if (strncmp(winver, "Windows 8.1", 11) == 0 || strncmp(winver, "Windows Server 2012 R2", 22) == 0) {
+                               dwWindowsMinorVersion = 3;
+                       }
+               }
+               
                snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d (%s) %s",
                                 "Windows NT", ComputerName,
                                 dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild, winver?winver:"unknown", wincpu);