WordPress.org

Making WordPress.org

Opened 5 weeks ago

Closed 5 weeks ago

Last modified 4 weeks ago

#3335 closed defect (fixed)

Plugin Checksum generation failing with filenames containing whitespace

Reported by: krisshannon Owned by: dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords: has-patch
Cc:

Description

Filenames with whitespace are being truncated at the first whitespace.

Attachments (1)

3335.diff (672 bytes) - added by krisshannon 5 weeks ago.

Download all attachments as: .zip

Change History (11)

@krisshannon
5 weeks ago

#1 @dd32
5 weeks ago

Hey @krisshannon,

Do you have an example plugin of where this is occurring?

#2 @krisshannon
5 weeks ago

  • Keywords has-patch added

https://wordpress.org/plugins/hummingbird-performance/

Specifically version 1.7.0.3 has a file called "externals/shared-ui/font/WPMU DEV Dashboard.json" but the checksum is recorded with a filename of "externals/shared-ui/font/WPMU"

Last edited 5 weeks ago by krisshannon (previous) (diff)

#3 @schlessera
5 weeks ago

Link to checksums of this plugin & version: https://downloads.wordpress.org/plugin-checksums/hummingbird-performance/1.7.0.3.json

Indeed, the filename was truncated at the first space.

#4 @dd32
5 weeks ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 6280:

Plugin Directory: Checksums: Correctly handle filenames with spaces, previously the filename was being truncated.

Props krisshannon.
Fixes #3335.

#5 @krisshannon
5 weeks ago

Hey @dd32

What if the plugin includes both a 'Testing' file as well as 'Testing Test'? If there is a new checksum for the 'Testing' file the old one will be lost.

Maybe the if ( isset( $skip_bad_files[ $file ] ) ) block should be moved inside the if ( ! isset( $json_checksum_file->files[ $file ] ) ) block.

Last edited 5 weeks ago by krisshannon (previous) (diff)

#6 @dd32
5 weeks ago

Good call @krisshannon - If this runs into any further problems I'm just going to remove the skip function though :)

#7 @dd32
5 weeks ago

In 6281:

Plugin Directory: Checksums: Move the $skip_bad_files into the non-existant file branch to avoid accidentally clobbering a real file.

Props krisshannon.
Fixes #3335.

#8 follow-up: @schlessera
4 weeks ago

@dd32 The checksums in https://downloads.wordpress.org/plugin-checksums/wd-instagram-feed/1.2.9 still contain a truncated filename ( see https://make.wordpress.org/cli/2017/12/09/call-for-action-help-us-test-checksum-verification/#comment-102 ).

Has this simply not been updated yet, or do you think we still have a problem with the generation.

The difference this time is that the file contains URL encoded spaces (%20) instead of actual spaces.

Last edited 4 weeks ago by schlessera (previous) (diff)

#9 @schlessera
4 weeks ago

Apparently, this is fixed in the following release's checksums file, so I assume the problem is just that older versions don't get recreated.

#10 in reply to: ↑ 8 @dd32
4 weeks ago

Replying to schlessera:

@dd32 The checksums in https://downloads.wordpress.org/plugin-checksums/wd-instagram-feed/1.2.9 still contain a truncated filename ( see https://make.wordpress.org/cli/2017/12/09/call-for-action-help-us-test-checksum-verification/#comment-102 ).

You'll need to report any truncated checksums, they won't be fixed retrospectively automatically unless there's a change to the plugin version.
Please post the filename of the truncated files too, as I'm not going to dig through the files to verify if it's fixed or not.
I've kicked off a job to rebuild the ZIPs (and therefor, checksums) of the mentioned plugin.

Note: See TracTickets for help on using tickets.