Code Duplication    Length = 24-29 lines in 2 locations

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

@@ 1570-1593 (lines=24) @@
1567
          // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
1568
          // to PCLZIP_OPT_BY_PREG
1569
          $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
1570
        case PCLZIP_OPT_BY_PREG :
1571
        //case PCLZIP_OPT_CRYPT :
1572
          // ----- Check the number of parameters
1573
          if (($i+1) >= $p_size) {
1574
            // ----- Error log
1575
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1576
1577
            // ----- Return
1578
            return PclZip::errorCode();
1579
          }
1580
1581
          // ----- Get the value
1582
          if (is_string($p_options_list[$i+1])) {
1583
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
1584
          }
1585
          else {
1586
            // ----- Error log
1587
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
1588
1589
            // ----- Return
1590
            return PclZip::errorCode();
1591
          }
1592
          $i++;
1593
        break;
1594
1595
        // ----- Look for options that takes a string
1596
        case PCLZIP_OPT_COMMENT :
@@ 1598-1626 (lines=29) @@
1595
        // ----- Look for options that takes a string
1596
        case PCLZIP_OPT_COMMENT :
1597
        case PCLZIP_OPT_ADD_COMMENT :
1598
        case PCLZIP_OPT_PREPEND_COMMENT :
1599
          // ----- Check the number of parameters
1600
          if (($i+1) >= $p_size) {
1601
            // ----- Error log
1602
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE,
1603
			                     "Missing parameter value for option '"
1604
								 .PclZipUtilOptionText($p_options_list[$i])
1605
								 ."'");
1606
1607
            // ----- Return
1608
            return PclZip::errorCode();
1609
          }
1610
1611
          // ----- Get the value
1612
          if (is_string($p_options_list[$i+1])) {
1613
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
1614
          }
1615
          else {
1616
            // ----- Error log
1617
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,
1618
			                     "Wrong parameter value for option '"
1619
								 .PclZipUtilOptionText($p_options_list[$i])
1620
								 ."'");
1621
1622
            // ----- Return
1623
            return PclZip::errorCode();
1624
          }
1625
          $i++;
1626
        break;
1627
1628
        // ----- Look for options that request an array of index
1629
        case PCLZIP_OPT_BY_INDEX :