From 56f776835db06bda4c66c488da75d907be5eb536 Mon Sep 17 00:00:00 2001
From: Sergey Biryukov <sergeybiryukov.ru@gmail.com>
Date: Thu, 12 Dec 2024 22:23:16 +0000
Subject: [PATCH] Filesystem API: Check `PHP_OS_FAMILY` instead of
 `php_uname()` in PclZip.

The `php_uname()` function can be disabled on some hosts, in which case the call fails.

The `PHP_OS_FAMILY` constant indicates the operating system family PHP was built for, and is available as of PHP 7.2.0.

Reference: [https://www.php.net/manual/en/reserved.constants.php#constant.php-os-family PHP Manual: Predefined Constants: PHP_OS_FAMILY].

Follow-up to [6779], [57985], [58678], [58684].

Props daymobrew, costdev, desrosj.
Fixes #57711.
Built from https://develop.svn.wordpress.org/trunk@59506


git-svn-id: http://core.svn.wordpress.org/trunk@58892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
 wp-admin/includes/class-pclzip.php | 2 +-
 wp-includes/version.php            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/wp-admin/includes/class-pclzip.php b/wp-admin/includes/class-pclzip.php
index 658fda5f22..f1128d900c 100644
--- a/wp-admin/includes/class-pclzip.php
+++ b/wp-admin/includes/class-pclzip.php
@@ -5714,7 +5714,7 @@
   // --------------------------------------------------------------------------------
   function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)
   {
-    if (stristr(php_uname(), 'windows')) {
+    if (PHP_OS_FAMILY == 'Windows') {
       // ----- Look for potential disk letter
       if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
           $p_path = substr($p_path, $v_position+1);
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 4d1c867e58..6690683917 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '6.8-alpha-59505';
+$wp_version = '6.8-alpha-59506';
 
 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.