Changeset 6280
- Timestamp:
- 12/15/2017 01:45:55 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/zip/class-builder.php
r6184 r6280 202 202 $existing_json_checksum_file = file_exists( $this->checksum_file ); 203 203 204 $skip_bad_files = array(); 204 205 $checksums = array(); 205 206 foreach ( array( 'md5' => 'md5sum', 'sha256' => 'sha256sum' ) as $checksum_type => $checksum_bin ) { 207 $checksum_output = array(); 206 208 $this->exec( sprintf( 207 209 'cd %s && find . -type f -print0 | sort -z | xargs -0 ' . $checksum_bin . ' 2>&1', … … 216 218 217 219 foreach ( $checksum_output as $line ) { 218 list( $checksum, $filename ) = preg_split( '!\s+!', $line );220 list( $checksum, $filename ) = preg_split( '!\s+!', $line, 2 ); 219 221 $filename = trim( preg_replace( '!^./!', '', $filename ) ); 220 222 $checksum = trim( $checksum ); 223 224 // See https://meta.trac.wordpress.org/ticket/3335 - Filenames like 'Testing Test' truncated to 'Testing' 225 if ( preg_match( '!^(\S+)\s+\S!', $filename, $m ) ) { 226 $skip_bad_files[ $m[1] ] = true; 227 } 221 228 222 229 if ( ! isset( $checksums[ $filename ] ) ) { … … 259 266 // Combine Checksums from existing files and the new files 260 267 foreach ( $existing_json_checksum_file->files as $file => $checksums ) { 268 if ( isset( $skip_bad_files[ $file ] ) ) { 269 // See https://meta.trac.wordpress.org/ticket/3335 270 // This is a partial filename, which shouldn't have been in the checksums. 271 continue; 272 } 261 273 if ( ! isset( $json_checksum_file->files[ $file ] ) ) { 262 274 // Deleted file, use existing checksums.
Note: See TracChangeset
for help on using the changeset viewer.