Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Error on template syncing #115

Open
pmwheatley opened this issue Oct 19, 2022 · 0 comments
Open

500 Error on template syncing #115

pmwheatley opened this issue Oct 19, 2022 · 0 comments

Comments

@pmwheatley
Copy link

Uncaught TypeError: basename(): Argument #1 ($path) must be of type string, PclZip given in /opt/bitnami/wordpress/wp-content/plugins/woocommerce-amazon-ebay-integration/connect.php:1195

Looking at

$tmpfile = wp_tempnam();
$zipfile = new PclZip( $tmpfile );
$zipsuccess = $zipfile->create( $filestozip , PCLZIP_OPT_REMOVE_PATH, $ebayDesignDir );
if ($zipsuccess) {
$headers = array(
'Cache-Control' => 'no-cache, must-revalidate',
'Pragma' => 'no-cache',
'Expires' => 'Thu, 01 Jan 1970 00:00:00 GMT',
'X-Codisto-Content-Type' => 'application/zip',
'Content-Type' => 'application/zip, application/octet-stream',
'Content-Disposition' => 'attachment; filename=' . basename( $zipfile ),
'Content-Length' => filesize( $tmpfile )
);
seems there is indeed an issue here. $zipfile is an instance of PclZip not a string as required by basename.

I can see why this throws an error for us, but can't see how it doesn't throw an error for all you other customers. Seems unrelated to either PHP, Wordpress or Woocommerce version.

Fix appears to be trivial: basename( $zipfile->zipname )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant