diff --git a/settings.json.docker b/settings.json.docker index ea25bba42..053b6b618 100644 --- a/settings.json.docker +++ b/settings.json.docker @@ -639,5 +639,5 @@ /* * Enable/Disable case-insensitive pad names. */ - "enforceLowerCasePadIds": "${ENFORCE_LOWER_CASE_PAD_IDS:false}" + "lowerCasePadIds": "${LOWER_CASE_PAD_IDS:false}" } diff --git a/settings.json.template b/settings.json.template index 13124fcfa..375c4db9c 100644 --- a/settings.json.template +++ b/settings.json.template @@ -640,5 +640,5 @@ /* * Enable/Disable case-insensitive pad names. */ - "enforceLowerCasePadIds": false + "lowerCasePadIds": false } diff --git a/src/node/db/PadManager.js b/src/node/db/PadManager.js index bbd227bd1..cdcb58176 100644 --- a/src/node/db/PadManager.js +++ b/src/node/db/PadManager.js @@ -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; diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index b76e135d1..9cf723eb6 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -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 = () => { diff --git a/src/tests/backend/specs/enforceLowerCasePadIds.js b/src/tests/backend/specs/lowerCasePadIds.js similarity index 92% rename from src/tests/backend/specs/enforceLowerCasePadIds.js rename to src/tests/backend/specs/lowerCasePadIds.js index e7d9fcfcf..478c7fe46 100644 --- a/src/tests/backend/specs/enforceLowerCasePadIds.js +++ b/src/tests/backend/specs/lowerCasePadIds.js @@ -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');