Browse Source

Merge pull request #2572 from nextcloud/e2ee20

E2ee20
Marino Faggiana 1 year ago
parent
commit
5e35add654
2 changed files with 8 additions and 4 deletions
  1. 2 2
      Nextcloud.xcodeproj/project.pbxproj
  2. 6 2
      iOSClient/Utility/NCUtility.swift

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -4661,7 +4661,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -4726,7 +4726,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 1;
+				CURRENT_PROJECT_VERSION = 2;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;

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