php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #70530
Patch php-uname-fix-for-windows-10 revision 2017-08-06 19:18 UTC by gideaow at gmail dot com
revision 2017-08-06 16:16 UTC by gideaow at gmail dot com
revision 2017-08-06 16:13 UTC by gideaow at gmail dot com
revision 2017-08-06 15:58 UTC by gideaow at gmail dot com

Patch php-uname-fix-for-windows-10 for PHP options/info functions Bug #70530

Patch version 2017-08-06 16:13 UTC

Return to Bug #70530 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions: 2017-08-06 19:18 UTC | 2017-08-06 16:16 UTC | 2017-08-06 16:13 UTC | 2017-08-06 15:58 UTC

Developer: gideaow@gmail.com

Line 1 (now 1), was 9 lines, now 7 lines
 function my_php_uname() {
 	$uname = php_uname();
 	if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
 		if (preg_match('/(Windows 8(\.\d+)?)/i', $uname, $match) AND preg_match('/Windows NT 10/i', $_SERVER['HTTP_USER_AGENT'])) {
 			$uname = str_replace($match[1], 'Windows 10', $uname);
 		}
 $uname = php_uname();
 if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
 	if (preg_match('/(Windows 8(\.\d+)?)/i', $uname, $match) AND preg_match('/Windows NT 10/i', $_SERVER['HTTP_USER_AGENT'])) {
 		$uname = str_replace($match[1], 'Windows 10', $uname);
  	}
 	return $uname;
  }
 echo $uname;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 08:01:29 2024 UTC