Skip to content

Commit 65ce791

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. Merges [61887] into the 6.9 branch. Props johnbillion, peterwilsoncc, xknown. git-svn-id: https://develop.svn.wordpress.org/branches/6.9@61935 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 97dc3ee commit 65ce791

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
@@ -1901,6 +1901,11 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
19011901
continue;
19021902
}
19031903

1904+
// Don't extract invalid files:
1905+
if ( 0 !== validate_file( $file['filename'] ) ) {
1906+
continue;
1907+
}
1908+
19041909
$uncompressed_size += $file['size'];
19051910

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

0 commit comments

Comments
 (0)