Added a (very long) length restriction to custom collection names

This commit is contained in:
Leon Styhre 2023-08-05 10:33:07 +02:00
parent 6c3406c9d8
commit b975fce8ff

View file

@ -559,6 +559,11 @@ std::string CollectionSystemsManager::getValidNewCollectionName(const std::strin
{
std::string name {inName};
if (name.length() > 160) {
LOG(LogWarning) << "Requested custom collection name is too long, shortening it";
name = name.substr(0, 160);
}
if (index == 0) {
size_t remove {std::string::npos};
// Remove invalid characters.