소스 검색

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
             }
         }