marinofaggiana 4 年之前
父节点
当前提交
e46ab6ad61
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      iOSClient/Utility/CCUtility.m

+ 1 - 4
iOSClient/Utility/CCUtility.m

@@ -1443,10 +1443,7 @@
             if (directory.e2eEncrypted == true) {
                 return true;
             }
-            NSURL *url = [NSURL URLWithString:serverUrl];
-            serverUrl = [url URLByDeletingLastPathComponent].absoluteString;
-            serverUrl = [serverUrl substringToIndex:[serverUrl length]-1];
-            if (serverUrl == nil) { return false; }
+            serverUrl = [CCUtility deletingLastPathComponentFromServerUrl:serverUrl];
             directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", account, serverUrl]];
         }