Make WordPress Core

Changeset 59506


Ignore:
Timestamp:
12/12/2024 10:21:21 PM (3 months ago)
Author:
SergeyBiryukov
Message:

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: PHP Manual: Predefined Constants: PHP_OS_FAMILY.

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

Props daymobrew, costdev, desrosj.
Fixes #57711.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-pclzip.php

    r57901 r59506  
    57155715  function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)
    57165716  {
    5717     if (stristr(php_uname(), 'windows')) {
     5717    if (PHP_OS_FAMILY == 'Windows') {
    57185718      // ----- Look for potential disk letter
    57195719      if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
Note: See TracChangeset for help on using the changeset viewer.