From 6c13e9be55bf6efdcb42ec88ff4ba5f463f7f897 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 23 Apr 2024 21:59:45 +0800 Subject: [PATCH] Prevent use of invalid characters for file provider domain names Signed-off-by: Claudio Cambra --- src/gui/macOS/fileproviderdomainmanager_mac.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/macOS/fileproviderdomainmanager_mac.mm b/src/gui/macOS/fileproviderdomainmanager_mac.mm index 6e59f621ac8f5..33e97355b45db 100644 --- a/src/gui/macOS/fileproviderdomainmanager_mac.mm +++ b/src/gui/macOS/fileproviderdomainmanager_mac.mm @@ -16,6 +16,7 @@ #import #include +#include #include "config.h" #include "fileproviderdomainmanager.h" @@ -31,7 +32,8 @@ QString domainIdentifierForAccount(const OCC::Account * const account) { Q_ASSERT(account); - return account->userIdAtHostWithPort(); + static const QRegularExpression illegalChars("[:/]"); + return account->userIdAtHostWithPort().replace(illegalChars, "-"); } QString domainIdentifierForAccount(const OCC::AccountPtr account)