Code Duplication    Length = 13-14 lines in 3 locations

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

@@ 1893-1906 (lines=14) @@
1890
1891
      // ----- Look for attribute
1892
      switch ($v_key) {
1893
        case PCLZIP_ATT_FILE_NAME :
1894
          if (!is_string($v_value)) {
1895
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1896
            return PclZip::errorCode();
1897
          }
1898
1899
          $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
1900
1901
          if ($p_filedescr['filename'] == '') {
1902
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
1903
            return PclZip::errorCode();
1904
          }
1905
1906
        break;
1907
1908
        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
1909
          if (!is_string($v_value)) {
@@ 1908-1920 (lines=13) @@
1905
1906
        break;
1907
1908
        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
1909
          if (!is_string($v_value)) {
1910
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1911
            return PclZip::errorCode();
1912
          }
1913
1914
          $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
1915
1916
          if ($p_filedescr['new_short_name'] == '') {
1917
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
1918
            return PclZip::errorCode();
1919
          }
1920
        break;
1921
1922
        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
1923
          if (!is_string($v_value)) {
@@ 1922-1934 (lines=13) @@
1919
          }
1920
        break;
1921
1922
        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
1923
          if (!is_string($v_value)) {
1924
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1925
            return PclZip::errorCode();
1926
          }
1927
1928
          $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
1929
1930
          if ($p_filedescr['new_full_name'] == '') {
1931
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
1932
            return PclZip::errorCode();
1933
          }
1934
        break;
1935
1936
        // ----- Look for options that takes a string
1937
        case PCLZIP_ATT_FILE_COMMENT :