Make WordPress Core

Opened 10 years ago

Last modified 4 years ago

#30963 new defect (bug)

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

Reported by: jnhghy's profile jnhghy Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
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 (5)

#1 @SergeyBiryukov
10 years ago

  • Component changed from Administration to Plugins
  • Focuses administration added

#2 follow-up: @dd32
10 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
10 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
7 years ago

  • Keywords needs-patch added

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

#5 @earnjam
4 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Version 4.1 deleted
Note: See TracTickets for help on using tickets.