WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 6 months ago

#30963 new defect (bug)

Wrong error message when uploading non-zip files on the plugin upload page

Reported by: jnhghy Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.1
Component: Plugins Keywords: needs-patch
Focuses: administration Cc:

Description

If you go to plugins -> upload plugin and you try to insall a .php file instead of a zip file you get this error message: Abort class-pclzip.php : Missing zlib extensions.
This error message is bad, zlib extensions are not missing, the file type is wrong.

Also this message is missing translation support (I might be wrong on this).

Change History (4)

#1 @SergeyBiryukov
3 years ago

  • Component changed from Administration to Plugins
  • Focuses administration added

#2 follow-up: @dd32
3 years ago

A non-zip currently errors out with the following message, which is pretty terrible, I agree.

The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

The error outlined in the ticket here, Abort class-pclzip.php : Missing zlib extensions occurs when the PHP installation is missing both ZipArchive support, and doesn't contain gzopen() (ie. missing zlib extension, or that ubuntu bug #30213). In this case all update-related functionality doesn't work, and we don't appear to check support properly.

#3 in reply to: ↑ 2 @dd32
3 years ago

Replying to dd32:

The error outlined in the ticket here, Abort class-pclzip.php : Missing zlib extensions occurs when the PHP installation is missing both ZipArchive support, and doesn't contain gzopen() (ie. missing zlib extension, or that ubuntu bug #30213). In this case all update-related functionality doesn't work, and we don't appear to check support properly.

Small clarification: If the install has ZipArchive support, but no gzopen() available, and a non-zip is uploaded, it'll also hit the above conditional, which is currently wrapped in a die()

#4 @DrewAPicture
6 months ago

  • Keywords needs-patch added

@jnhghy If you were interestedin submitting a patch to improve this error message, I could get behind that.

Note: See TracTickets for help on using tickets.