Skip to content

Commit 513d48f

Browse files
committed
Patches #67739
Fixes #67739: Windows 8.1/Server 2012 R2 OS build number reported as 6.2 (instead of 6.3)
1 parent 60cc43a commit 513d48f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/standard/info.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,14 @@ PHPAPI char *php_get_uname(char mode)
592592

593593
php_get_windows_cpu(wincpu, sizeof(wincpu));
594594
dwBuild = (DWORD)(HIWORD(dwVersion));
595+
596+
/* Windows "version" 6.2 could be Windows 8/Windows Server 2012, but also Windows 8.1/Windows Server 2012 R2 */
597+
if (dwWindowsMajorVersion == 6 && dwWindowsMinorVersion == 2) {
598+
if (strncmp(winver, "Windows 8.1", 11) == 0 || strncmp(winver, "Windows Server 2012 R2", 22) == 0) {
599+
dwWindowsMinorVersion = 3;
600+
}
601+
}
602+
595603
snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d (%s) %s",
596604
"Windows NT", ComputerName,
597605
dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild, winver?winver:"unknown", wincpu);

0 commit comments

Comments
 (0)