rename enforceLowerCasePadIds to lowerCasePadIds

This commit is contained in:
Daniel Habenicht 2022-04-26 11:02:52 +02:00 committed by SamTV12345
parent 11e7e703fb
commit 70a513749a
5 changed files with 8 additions and 8 deletions

View file

@ -639,5 +639,5 @@
/*
* Enable/Disable case-insensitive pad names.
*/
"enforceLowerCasePadIds": "${ENFORCE_LOWER_CASE_PAD_IDS:false}"
"lowerCasePadIds": "${LOWER_CASE_PAD_IDS:false}"
}

View file

@ -640,5 +640,5 @@
/*
* Enable/Disable case-insensitive pad names.
*/
"enforceLowerCasePadIds": false
"lowerCasePadIds": false
}

View file

@ -171,7 +171,7 @@ exports.sanitizePadId = async (padId) => {
padId = padId.replace(from, to);
}
if (settings.enforceLowerCasePadIds) padId = padId.toLowerCase();
if (settings.lowerCasePadIds) padId = padId.toLowerCase();
// we're out of possible transformations, so just return it
return padId;

View file

@ -434,7 +434,7 @@ exports.enableAdminUITests = false;
* Enable auto conversion of pad Ids to lowercase.
* e.g. /p/EtHeRpAd to /p/etherpad
*/
exports.enforceLowerCasePadIds = false;
exports.lowerCasePadIds = false;
// checks if abiword is avaiable
exports.abiwordAvailable = () => {

View file

@ -27,7 +27,7 @@ describe(__filename, function () {
describe('not activated', function () {
Object.assign(settings, {
enforceLowerCasePadIds: false,
lowerCasePadIds: false,
});
it('- do nothing', async function () {
const res = await agent.get('/p/UPPERCASEpad');
@ -43,7 +43,7 @@ describe(__filename, function () {
describe('activated', function () {
it('- lowercase pad ids', async function () {
Object.assign(settings, {
enforceLowerCasePadIds: true,
lowerCasePadIds: true,
});
await agent.get('/p/UPPERCASEpad')
.expect(302)
@ -52,13 +52,13 @@ describe(__filename, function () {
it('- keeps old pads accessible', async function () {
Object.assign(settings, {
enforceLowerCasePadIds: false,
lowerCasePadIds: false,
});
const pad = await padManager.getPad('ALREADYexistingPad', 'alreadyexistingpad');
await padManager.getPad('ALREADYexistingPad', 'bla');
assert.equal(pad.text(), 'alreadyexistingpad\n');
Object.assign(settings, {
enforceLowerCasePadIds: true,
lowerCasePadIds: true,
});
const newpad = await padManager.getPad('alreadyexistingpad', 'testcontent');