Explorar el Código

trim withespaces in save func in NCCreateFormUploadDocuments

Signed-off-by: McP4nth3r <burg41@yahoo.de>
McP4nth3r hace 3 años
padre
commit
40df873b2f
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

+ 3 - 0
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -274,6 +274,9 @@ import XLForm
             return
         } else {
 
+            //Trim whitespaces after checks above
+            fileNameForm = fileNameForm.trimmingCharacters(in: .whitespacesAndNewlines)
+
             let result = NCCommunicationCommon.shared.getInternalType(fileName: fileNameForm as! String, mimeType: "", directory: false)
             if NCUtility.shared.isDirectEditing(account: appDelegate.account, contentType: result.mimeType).count == 0 {
                 fileNameForm = (fileNameForm as! NSString).deletingPathExtension + "." + fileNameExtension