Skip to content

Commit

Permalink
Prevent use of invalid characters for file provider domain names
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and camilasan committed Apr 23, 2024
1 parent 8f6c19e commit 10faa00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/macOS/fileproviderdomainmanager_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import <FileProvider/FileProvider.h>

#include <QLoggingCategory>
#include <QRegularExpression>

#include "config.h"
#include "fileproviderdomainmanager.h"
Expand All @@ -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)
Expand Down

0 comments on commit 10faa00

Please sign in to comment.