Skip to content

Commit e2b0bfd

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@59506 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9104190 commit e2b0bfd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-admin/includes/class-pclzip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5714,7 +5714,7 @@ function PclZipUtilOptionText($p_option)
57145714
// --------------------------------------------------------------------------------
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)) {
57205720
$p_path = substr($p_path, $v_position+1);

0 commit comments

Comments
 (0)