Code Duplication    Length = 7-11 lines in 6 locations

src/wp-admin/includes/class-pclzip.php 6 locations

@@ 2255-2261 (lines=7) @@
2252
2253
    // ----- Copy the block of file headers from the old archive
2254
    $v_size = $v_central_dir['size'];
2255
    while ($v_size != 0)
2256
    {
2257
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
2258
      $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
2259
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
2260
      $v_size -= $v_read_size;
2261
    }
2262
2263
    // ----- Create the Central Dir files header
2264
    for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)
@@ 2885-2892 (lines=8) @@
2882
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
2883
    fseek($v_file_compressed, 10);
2884
    $v_size = $p_header['compressed_size'];
2885
    while ($v_size != 0)
2886
    {
2887
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
2888
      $v_buffer = @fread($v_file_compressed, $v_read_size);
2889
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
2890
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
2891
      $v_size -= $v_read_size;
2892
    }
2893
2894
    // ----- Close the file
2895
    @fclose($v_file_compressed);
@@ 3842-3852 (lines=11) @@
3839
3840
          // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
3841
          $v_size = $p_entry['compressed_size'];
3842
          while ($v_size != 0)
3843
          {
3844
            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
3845
            $v_buffer = @fread($this->zip_fd, $v_read_size);
3846
            /* Try to speed up the code
3847
            $v_binary_data = pack('a'.$v_read_size, $v_buffer);
3848
            @fwrite($v_dest_file, $v_binary_data, $v_read_size);
3849
            */
3850
            @fwrite($v_dest_file, $v_buffer, $v_read_size);
3851
            $v_size -= $v_read_size;
3852
          }
3853
3854
          // ----- Closing the destination file
3855
          fclose($v_dest_file);
@@ 3986-3993 (lines=8) @@
3983
3984
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
3985
    $v_size = $p_entry['compressed_size'];
3986
    while ($v_size != 0)
3987
    {
3988
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
3989
      $v_buffer = @fread($this->zip_fd, $v_read_size);
3990
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
3991
      @fwrite($v_dest_file, $v_buffer, $v_read_size);
3992
      $v_size -= $v_read_size;
3993
    }
3994
3995
    // ----- Write gz file format footer
3996
    $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);
@@ 5152-5158 (lines=7) @@
5149
5150
    // ----- Copy the block of file headers from the old archive
5151
    $v_size = $v_central_dir['size'];
5152
    while ($v_size != 0)
5153
    {
5154
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
5155
      $v_buffer = @fread($this->zip_fd, $v_read_size);
5156
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
5157
      $v_size -= $v_read_size;
5158
    }
5159
5160
    // ----- Copy the block of file headers from the archive_to_add
5161
    $v_size = $v_central_dir_to_add['size'];
@@ 5162-5168 (lines=7) @@
5159
5160
    // ----- Copy the block of file headers from the archive_to_add
5161
    $v_size = $v_central_dir_to_add['size'];
5162
    while ($v_size != 0)
5163
    {
5164
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
5165
      $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
5166
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
5167
      $v_size -= $v_read_size;
5168
    }
5169
5170
    // ----- Merge the file comments
5171
    $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];