浏览代码

Update NCUtility.swift

Marino Faggiana 1 年之前
父节点
当前提交
81e048d6ec
共有 1 个文件被更改,包括 6 次插入2 次删除
  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
             }
         }