Update backup formats to filter out non-whitelisted characters

This commit is contained in:
Ryan Huffman 2018-02-26 14:29:13 -08:00
parent dbfbee5406
commit cd9cdea3e8

View file

@ -74,7 +74,9 @@ void DomainContentBackupManager::parseBackupRules(const QVariantList& backupRule
int interval = map["backupInterval"].toInt();
int count = map["maxBackupVersions"].toInt();
auto name = map["Name"].toString();
auto format = name.replace(" ", "_").toLower();
auto format = name.toLower();
QRegExp matchDisallowedCharacters { "[^a-zA-Z0-9\\-_]+" };
format.replace(matchDisallowedCharacters, "_");
qCDebug(domain_server) << " Name:" << name;
qCDebug(domain_server) << " format:" << format;