New option to make pad names case-insensitive

fixes #3844
This commit is contained in:
DanielHabenicht 2022-04-08 10:22:19 +00:00 committed by SamTV12345
parent 22704f7dff
commit bd4a4ae8cf
5 changed files with 89 additions and 2 deletions

View file

@ -22,6 +22,7 @@
const CustomError = require('../utils/customError');
const Pad = require('../db/Pad');
const db = require('./DB');
const settings = require('../utils/Settings');
/**
* A cache of all loaded Pads.
@ -170,6 +171,8 @@ exports.sanitizePadId = async (padId) => {
padId = padId.replace(from, to);
}
if (settings.enforceLowerCasePadIds) padId = padId.toLowerCase();
// we're out of possible transformations, so just return it
return padId;
};