WordPress.org

Make WordPress Core

Changeset 42010


Ignore:
Timestamp:
10/24/2017 11:10:37 PM (21 months ago)
Author:
johnbillion
Message:

Filesystem API: Don't immediately return an error for invalid file names contained within a Zip while it's being extracted.

This allows the extraction of the rest of the valid files within the archive to continue.

See #42016

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r42007 r42010  
    11201120            continue;
    11211121
     1122        // Don't extract invalid files:
    11221123        if ( 0 !== validate_file( $info['name'] ) ) {
    1123             return new WP_Error( 'invalid_file_ziparchive', __( 'Could not extract file from archive.' ), $info['name'] );
     1124            continue;
    11241125        }
    11251126
     
    11811182            continue;
    11821183
     1184        // Don't extract invalid files:
     1185        if ( 0 !== validate_file( $info['name'] ) ) {
     1186            continue;
     1187        }
     1188
    11831189        $contents = $z->getFromIndex($i);
    11841190        if ( false === $contents )
     
    12841290            continue;
    12851291
     1292        // Don't extract invalid files:
    12861293        if ( 0 !== validate_file( $file['filename'] ) ) {
    1287             return new WP_Error( 'invalid_file_pclzip', __( 'Could not extract file from archive.' ), $file['filename'] );
     1294            continue;
    12881295        }
    12891296
Note: See TracChangeset for help on using the changeset viewer.