diff --git a/src/wp-admin/includes/class-pclzip.php b/src/wp-admin/includes/class-pclzip.php index b8f2fdca86..b1b39e2dfe 100644 --- a/src/wp-admin/includes/class-pclzip.php +++ b/src/wp-admin/includes/class-pclzip.php @@ -2674,7 +2674,12 @@ } // ----- Read the file content - $v_content = @fread($v_file, $p_header['size']); + if ($p_header['size'] > 0) { + $v_content = @fread($v_file, $p_header['size']); + } + else { + $v_content = ''; + } // ----- Close the file @fclose($v_file); @@ -3884,11 +3889,11 @@ // ----- Read the compressed file in a buffer (one shot) - if ( $p_entry['compressed_size'] > 0 ) { + if ($p_entry['compressed_size'] > 0) { $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); } else { - $v_buffer = false; + $v_buffer = ''; } // ----- Decompress the file @@ -4101,11 +4106,11 @@ if ($p_entry['compressed_size'] == $p_entry['size']) { // ----- Read the file in a buffer (one shot) - if ( $p_entry['compressed_size'] > 0 ) { + if ($p_entry['compressed_size'] > 0) { $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); } else { - $v_buffer = false; + $v_buffer = ''; } // ----- Send the file to the output @@ -4115,11 +4120,11 @@ else { // ----- Read the compressed file in a buffer (one shot) - if ( $p_entry['compressed_size'] > 0 ) { + if ($p_entry['compressed_size'] > 0) { $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); } else { - $v_buffer = false; + $v_buffer = ''; } // ----- Decompress the file @@ -4224,21 +4229,21 @@ if ($p_entry['compression'] == 0) { // ----- Reading the file - if ( $p_entry['compressed_size'] > 0 ) { + if ($p_entry['compressed_size'] > 0) { $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); } else { - $p_string = false; + $p_string = ''; } } else { // ----- Reading the file - if ( $p_entry['compressed_size'] > 0 ) { + if ($p_entry['compressed_size'] > 0) { $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); } else { - $v_data = false; + $v_data = ''; } // ----- Decompress the file