mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Prevent use of invalid characters for file provider domain names
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
8f6c19e029
commit
591d5eebd2
1 changed files with 3 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
||||||
#import <FileProvider/FileProvider.h>
|
#import <FileProvider/FileProvider.h>
|
||||||
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "fileproviderdomainmanager.h"
|
#include "fileproviderdomainmanager.h"
|
||||||
|
@ -31,7 +32,8 @@ namespace {
|
||||||
QString domainIdentifierForAccount(const OCC::Account * const account)
|
QString domainIdentifierForAccount(const OCC::Account * const account)
|
||||||
{
|
{
|
||||||
Q_ASSERT(account);
|
Q_ASSERT(account);
|
||||||
return account->userIdAtHostWithPort();
|
static const QRegularExpression illegalChars("[:/]");
|
||||||
|
return account->userIdAtHostWithPort().replace(illegalChars, "-");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString domainIdentifierForAccount(const OCC::AccountPtr account)
|
QString domainIdentifierForAccount(const OCC::AccountPtr account)
|
||||||
|
|
Loading…
Reference in a new issue