diff --git a/src/wp-admin/includes/class-pclzip.php b/src/wp-admin/includes/class-pclzip.php index ae0af7a8f101c..93446efc5a4a8 100644 --- a/src/wp-admin/includes/class-pclzip.php +++ b/src/wp-admin/includes/class-pclzip.php @@ -4205,11 +4205,16 @@ function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) // ----- Do the extraction (if not a folder) if (!(($p_entry['external']&0x00000010)==0x00000010)) { // ----- Look for not compressed file - // if ($p_entry['compressed_size'] == $p_entry['size']) if ($p_entry['compression'] == 0) { - - // ----- Reading the file - $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); + if ($p_entry['compressed_size'] == 0){ + // ----- Fread requires a non zero length parameter + // ----- Reading the file + $p_string = @fread($this->zip_fd, filesize($this->zipname)); + } + else { + // ----- Reading the file + $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); + } } else {