Ticket #52018: 52018.diff
File 52018.diff, 2.5 KB (added by , 4 years ago) |
---|
-
src/wp-admin/includes/class-pclzip.php
3884 3884 3885 3885 3886 3886 // ----- Read the compressed file in a buffer (one shot) 3887 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 3887 if ( $p_entry['compressed_size'] > 0 ) { 3888 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 3889 } 3890 else { 3891 $v_buffer = false; 3892 } 3888 3893 3889 3894 // ----- Decompress the file 3890 3895 $v_file_content = @gzinflate($v_buffer); … … 4096 4101 if ($p_entry['compressed_size'] == $p_entry['size']) { 4097 4102 4098 4103 // ----- Read the file in a buffer (one shot) 4099 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 4104 if ( $p_entry['compressed_size'] > 0 ) { 4105 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 4106 } 4107 else { 4108 $v_buffer = false; 4109 } 4100 4110 4101 4111 // ----- Send the file to the output 4102 4112 echo $v_buffer; … … 4105 4115 else { 4106 4116 4107 4117 // ----- Read the compressed file in a buffer (one shot) 4108 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 4118 if ( $p_entry['compressed_size'] > 0 ) { 4119 $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); 4120 } 4121 else { 4122 $v_buffer = false; 4123 } 4109 4124 4110 4125 // ----- Decompress the file 4111 4126 $v_file_content = gzinflate($v_buffer); … … 4209 4224 if ($p_entry['compression'] == 0) { 4210 4225 4211 4226 // ----- Reading the file 4212 $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); 4227 if ( $p_entry['compressed_size'] > 0 ) { 4228 $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); 4229 } 4230 else { 4231 $p_string = false; 4232 } 4213 4233 } 4214 4234 else { 4215 4235 4216 4236 // ----- Reading the file 4217 $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); 4237 if ( $p_entry['compressed_size'] > 0 ) { 4238 $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); 4239 } 4240 else { 4241 $v_data = false; 4242 } 4218 4243 4219 4244 // ----- Decompress the file 4220 4245 if (($p_string = @gzinflate($v_data)) === FALSE) {