Make WordPress Core

Opened 14 months ago

Last modified 5 months ago

#57711 new defect (bug)

PclZipUtilTranslateWinPath() fails when php_uname() function not available

Reported by: daymobrew's profile daymobrew Owned by:
Milestone: Future Release Priority: normal
Severity: minor Version: 6.1.1
Component: External Libraries Keywords: has-patch
Focuses: Cc:


In PclZip class (wp-admin/includes/class-pclzip.php) PclZipUtilTranslateWinPath() calls php_uname(). If that function is disabled then the call fails.

php_uname() is disabled on EasyWP host (part of Namecheap).

Core handles this by checking whether php_uname() exists (in wp-admin/includes/class-wp-debug.php).

Is it possible to get PclZip to do the same? I checked PclZip host site ( but there was no contact info there.

This error arose while using

Change History (3)

#1 @desrosj
7 months ago

  • Milestone changed from Awaiting Review to Future Release

Hi @daymobrew,

Welcome to Trac! First, my apologies that this took so long to get a response.

I did a bit of digging, and found this repository on GitHub that appears to be where this library is maintained. Core is running version 2.8.2, but 2.8.3 is available upstream. Though none of the changes appear to be related to your specific issue, and there has been no effort to make the library PHP >= 8 compatible. So I think it's fine to consider this library "adopted" by WordPress.

I think adding a functions_exists() check is reasonable. However, I'm not too familiar with Windows, so I'm not sure what the consequences could be for scenarios where the logic within that if() statement should execute.

This ticket was mentioned in PR #5334 on WordPress/wordpress-develop by @costdev.

7 months ago

  • Keywords has-patch added

Some hosts disable php_uname().
To ensure detection of Windows continues, check PHP_OS.

jhult commented on PR #5334:

5 months ago

@costdev and @desrosj,

Any news on this?

Note: See TracTickets for help on using tickets.