Make WordPress Core

Opened 22 months ago

Last modified 12 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:

Description

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).
https://www.namecheap.com/support/knowledgebase/article.aspx/9901/2279/easywp-list-of-php-functions-disabled-on-easywp-platform/

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 (http://www.phpconcept.net) but there was no contact info there.

This error arose while using https://wordpress.org/plugins/simply-static/

Change History (3)

#1 @desrosj
15 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.


15 months ago
#2

  • Keywords has-patch added

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

jhult commented on PR #5334:


12 months ago
#3

@costdev and @desrosj,

Any news on this?

Note: See TracTickets for help on using tickets.