Prechádzať zdrojové kódy

Update NCUtility.swift

Marino Faggiana 1 rok pred
rodič
commit
81e048d6ec
1 zmenil súbory, kde vykonal 6 pridanie a 2 odobranie
  1. 6 2
      iOSClient/Utility/NCUtility.swift

+ 6 - 2
iOSClient/Utility/NCUtility.swift

@@ -765,8 +765,12 @@ class NCUtility: NSObject {
     }
 
     func isDirectoryE2EETop(account: String, serverUrl: String) -> Bool {
-        if let url = URL(string: serverUrl)?.deletingLastPathComponent() {
-            if let directory = NCManageDatabase.shared.getTableDirectory(account: account, serverUrl: String(url.absoluteString.dropLast())) {
+
+        guard var serverUrl = serverUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { return false }
+        
+        if let url = URL(string: serverUrl)?.deletingLastPathComponent(),
+           let serverUrl = String(url.absoluteString.dropLast()).removingPercentEncoding {
+            if let directory = NCManageDatabase.shared.getTableDirectory(account: account, serverUrl: serverUrl) {
                 return !directory.e2eEncrypted
             }
         }