Code Duplication    Length = 9-16 lines in 3 locations

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

@@ 3757-3765 (lines=9) @@
3754
        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
3755
        // For historical reason first PclZip implementation does not stop
3756
        // when this kind of error occurs.
3757
        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
3758
		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
3759
3760
            PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,
3761
			                     "Filename '".$p_entry['filename']."' is "
3762
								 ."already used by an existing directory");
3763
3764
            return PclZip::errorCode();
3765
		    }
3766
      }
3767
      // ----- Look if file is write protected
3768
      else if (!is_writeable($p_entry['filename']))
@@ 3777-3785 (lines=9) @@
3774
        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
3775
        // For historical reason first PclZip implementation does not stop
3776
        // when this kind of error occurs.
3777
        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
3778
		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
3779
3780
            PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
3781
			                     "Filename '".$p_entry['filename']."' exists "
3782
								 ."and is write protected");
3783
3784
            return PclZip::errorCode();
3785
		    }
3786
      }
3787
3788
      // ----- Look if the extracted file is older
@@ 3795-3810 (lines=16) @@
3792
        if (   (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))
3793
		    && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {
3794
	  	  }
3795
		    else {
3796
            $p_entry['status'] = "newer_exist";
3797
3798
            // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
3799
            // For historical reason first PclZip implementation does not stop
3800
            // when this kind of error occurs.
3801
            if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
3802
		        && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
3803
3804
                PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
3805
			             "Newer version of '".$p_entry['filename']."' exists "
3806
					    ."and option PCLZIP_OPT_REPLACE_NEWER is not selected");
3807
3808
                return PclZip::errorCode();
3809
		      }
3810
		    }
3811
      }
3812
      else {
3813
      }