fix: Add space to the valid index characters list (#2316)
This commit is contained in:
parent
a9d758bb0c
commit
7ae3addea0
|
@ -69,7 +69,7 @@ router.post("collections.create", auth(), async (ctx) => {
|
||||||
if (index) {
|
if (index) {
|
||||||
ctx.assertIndexCharacters(
|
ctx.assertIndexCharacters(
|
||||||
index,
|
index,
|
||||||
"Index characters must be between x21 to x7E ASCII"
|
"Index characters must be between x20 to x7E ASCII"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
index = fractionalIndex(
|
index = fractionalIndex(
|
||||||
|
@ -664,7 +664,7 @@ router.post("collections.move", auth(), async (ctx) => {
|
||||||
ctx.assertPresent(index, "index is required");
|
ctx.assertPresent(index, "index is required");
|
||||||
ctx.assertIndexCharacters(
|
ctx.assertIndexCharacters(
|
||||||
index,
|
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");
|
ctx.assertUuid(id, "id must be a uuid");
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,6 @@
|
||||||
"Contents": "Contents",
|
"Contents": "Contents",
|
||||||
"Headings you add to the document will appear here": "Headings you add to the document will appear here",
|
"Headings you add to the document will appear here": "Headings you add to the document will appear here",
|
||||||
"Table of contents": "Table of contents",
|
"Table of contents": "Table of contents",
|
||||||
"Contents": "Contents",
|
|
||||||
"By {{ author }}": "By {{ author }}",
|
"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 }} 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?",
|
"Are you sure you want to make {{ userName }} a member?": "Are you sure you want to make {{ userName }} a member?",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
export const validateIndexCharacters = (index: string) =>
|
export const validateIndexCharacters = (index: string) =>
|
||||||
/^[\x21-\x7E]+$/i.test(index);
|
new RegExp("^[\x20-\x7E]+$").test(index);
|
||||||
|
|
Reference in New Issue