Code Duplication    Length = 5-6 lines in 3 locations

main/inc/lib/pclzip/pclzip.lib.php 3 locations

@@ 2834-2838 (lines=5) @@
2831
2832
    // ----- Creates a compressed temporary file
2833
    $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
2834
    if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) {
2835
      fclose($v_file);
2836
      PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
2837
      return PclZip::errorCode();
2838
    }
2839
2840
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
2841
    $v_size = filesize($p_filename);
@@ 3992-3996 (lines=5) @@
3989
3990
    // ----- Creates a temporary file
3991
    $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
3992
    if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) {
3993
      fclose($v_file);
3994
      PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
3995
      return PclZip::errorCode();
3996
    }
3997
3998
3999
    // ----- Write gz file format header
@@ 4028-4033 (lines=6) @@
4025
    }
4026
4027
    // ----- Open the temporary gz file
4028
    if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {
4029
      @fclose($v_dest_file);
4030
      $p_entry['status'] = "read_error";
4031
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
4032
      return PclZip::errorCode();
4033
    }
4034
4035
4036
    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks