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 <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra authored and camilasan committed Apr 23, 2024
1 parent 4a4ce04 commit c67820b
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 c67820b

Please sign in to comment.