Skip to content

Commit 03f9ae1

Browse files
committed
Filesystem API: Don't attempt to extract invalid files from a zip when using the PclZip library.
This brings the handling inline with the same guard condition in `_unzip_file_ziparchive()` with ZipArchive. Props johnbillion, peterwilsoncc, xknown. git-svn-id: https://develop.svn.wordpress.org/trunk@61887 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bbe0511 commit 03f9ae1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/wp-admin/includes/file.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,11 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
18951895
continue;
18961896
}
18971897

1898+
// Don't extract invalid files:
1899+
if ( 0 !== validate_file( $archive_file['filename'] ) ) {
1900+
continue;
1901+
}
1902+
18981903
$uncompressed_size += $archive_file['size'];
18991904

19001905
$needed_dirs[] = $to . untrailingslashit( $archive_file['folder'] ? $archive_file['filename'] : dirname( $archive_file['filename'] ) );

0 commit comments

Comments
 (0)