diff --git a/server/api/collections.js b/server/api/collections.js index 70eec6d1..8c4e2471 100644 --- a/server/api/collections.js +++ b/server/api/collections.js @@ -69,7 +69,7 @@ router.post("collections.create", auth(), async (ctx) => { if (index) { ctx.assertIndexCharacters( index, - "Index characters must be between x21 to x7E ASCII" + "Index characters must be between x20 to x7E ASCII" ); } else { index = fractionalIndex( @@ -664,7 +664,7 @@ router.post("collections.move", auth(), async (ctx) => { ctx.assertPresent(index, "index is required"); ctx.assertIndexCharacters( index, - "Index characters must be between x21 to x7E ASCII" + "Index characters must be between x20 to x7E ASCII" ); ctx.assertUuid(id, "id must be a uuid"); diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 70f51d4a..22574f02 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -219,7 +219,6 @@ "Contents": "Contents", "Headings you add to the document will appear here": "Headings you add to the document will appear here", "Table of contents": "Table of contents", - "Contents": "Contents", "By {{ author }}": "By {{ author }}", "Are you sure you want to make {{ userName }} an admin? Admins can modify team and billing information.": "Are you sure you want to make {{ userName }} an admin? Admins can modify team and billing information.", "Are you sure you want to make {{ userName }} a member?": "Are you sure you want to make {{ userName }} a member?", diff --git a/shared/utils/indexCharacters.js b/shared/utils/indexCharacters.js index 62e81047..cff34204 100644 --- a/shared/utils/indexCharacters.js +++ b/shared/utils/indexCharacters.js @@ -1,4 +1,4 @@ // @flow export const validateIndexCharacters = (index: string) => - /^[\x21-\x7E]+$/i.test(index); + new RegExp("^[\x20-\x7E]+$").test(index);