Code Duplication    Length = 13-14 lines in 3 locations

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

@@ 1908-1921 (lines=14) @@
1905
1906
      // ----- Look for attribute
1907
      switch ($v_key) {
1908
        case PCLZIP_ATT_FILE_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['filename'] = PclZipUtilPathReduction($v_value);
1915
1916
          if ($p_filedescr['filename'] == '') {
1917
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
1918
            return PclZip::errorCode();
1919
          }
1920
1921
        break;
1922
1923
        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
1924
          if (!is_string($v_value)) {
@@ 1923-1935 (lines=13) @@
1920
1921
        break;
1922
1923
        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
1924
          if (!is_string($v_value)) {
1925
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1926
            return PclZip::errorCode();
1927
          }
1928
1929
          $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
1930
1931
          if ($p_filedescr['new_short_name'] == '') {
1932
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
1933
            return PclZip::errorCode();
1934
          }
1935
        break;
1936
1937
        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
1938
          if (!is_string($v_value)) {
@@ 1937-1949 (lines=13) @@
1934
          }
1935
        break;
1936
1937
        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
1938
          if (!is_string($v_value)) {
1939
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
1940
            return PclZip::errorCode();
1941
          }
1942
1943
          $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
1944
1945
          if ($p_filedescr['new_full_name'] == '') {
1946
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
1947
            return PclZip::errorCode();
1948
          }
1949
        break;
1950
1951
        // ----- Look for options that takes a string
1952
        case PCLZIP_ATT_FILE_COMMENT :