Code Duplication    Length = 30-32 lines in 2 locations

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

@@ 3406-3437 (lines=32) @@
3403
      */
3404
3405
      // ----- Look for extract by preg rule
3406
      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
3407
               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
3408
3409
          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
3410
              $v_extract = true;
3411
          }
3412
      }
3413
3414
      // ----- Look for extract by index rule
3415
      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
3416
               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
3417
3418
          // ----- Look if the index is in the list
3419
          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
3420
3421
              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
3422
                  $v_extract = true;
3423
              }
3424
              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
3425
                  $j_start = $j+1;
3426
              }
3427
3428
              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
3429
                  break;
3430
              }
3431
          }
3432
      }
3433
3434
      // ----- Look for no rule, which means extract all the archive
3435
      else {
3436
          $v_extract = true;
3437
      }
3438
3439
	  // ----- Check compression method
3440
	  if (   ($v_extract)
@@ 4782-4811 (lines=30) @@
4779
      */
4780
4781
      // ----- Look for extract by preg rule
4782
      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
4783
               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
4784
4785
          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
4786
              $v_found = true;
4787
          }
4788
      }
4789
4790
      // ----- Look for extract by index rule
4791
      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
4792
               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
4793
4794
          // ----- Look if the index is in the list
4795
          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {
4796
4797
              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
4798
                  $v_found = true;
4799
              }
4800
              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
4801
                  $j_start = $j+1;
4802
              }
4803
4804
              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
4805
                  break;
4806
              }
4807
          }
4808
      }
4809
      else {
4810
      	$v_found = true;
4811
      }
4812
4813
      // ----- Look for deletion
4814
      if ($v_found)