~canonical-sysadmins/wordpress/4.9.2

« back to all changes in this revision

Viewing changes to wp-admin/includes/file.php

  • Committer: Barry Price
  • Date: 2017-09-20 02:35:11 UTC
  • mfrom: (1.1.28 upstream)
  • Revision ID: barry.price@canonical.com-20170920023511-9bvjr2gseb4rb1e4
Merge WP4.8.2 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
647
647
                if ( '__MACOSX/' === substr($info['name'], 0, 9) ) // Skip the OS X-created __MACOSX directory
648
648
                        continue;
649
649
 
 
650
                if ( 0 !== validate_file( $info['name'] ) ) {
 
651
                        return new WP_Error( 'invalid_file_ziparchive', __( 'Could not extract file from archive.' ), $info['name'] );
 
652
                }
 
653
 
650
654
                $uncompressed_size += $info['size'];
651
655
 
652
656
                if ( '/' === substr( $info['name'], -1 ) ) {
807
811
                if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Don't extract the OS X-created __MACOSX directory files
808
812
                        continue;
809
813
 
 
814
                if ( 0 !== validate_file( $file['filename'] ) ) {
 
815
                        return new WP_Error( 'invalid_file_pclzip', __( 'Could not extract file from archive.' ), $file['filename'] );
 
816
                }
 
817
 
810
818
                if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE) )
811
819
                        return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] );
812
820
        }