Make WordPress Core

Ticket #52018: 52018.diff

File 52018.diff, 2.5 KB (added by SergeyBiryukov, 4 years ago)
  • src/wp-admin/includes/class-pclzip.php

     
    38843884
    38853885
    38863886            // ----- 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            }
    38883893
    38893894            // ----- Decompress the file
    38903895            $v_file_content = @gzinflate($v_buffer);
     
    40964101        if ($p_entry['compressed_size'] == $p_entry['size']) {
    40974102
    40984103          // ----- 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          }
    41004110
    41014111          // ----- Send the file to the output
    41024112          echo $v_buffer;
     
    41054115        else {
    41064116
    41074117          // ----- 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          }
    41094124
    41104125          // ----- Decompress the file
    41114126          $v_file_content = gzinflate($v_buffer);
     
    42094224        if ($p_entry['compression'] == 0) {
    42104225
    42114226          // ----- 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          }
    42134233        }
    42144234        else {
    42154235
    42164236          // ----- 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          }
    42184243
    42194244          // ----- Decompress the file
    42204245          if (($p_string = @gzinflate($v_data)) === FALSE) {