diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts index d85c7f3ff3b966fe094f9bb1c21e8a35856c1bd5..90854e450499987ff83b45959015cbf070b5ad7c 100644 --- a/frontend/src/utils/index.ts +++ b/frontend/src/utils/index.ts @@ -125,6 +125,7 @@ function stringContainsIllegalChars(string: string): boolean { // Only allow the following characters: // ----- Basic Latin ----- // U+0020 (Space) + // U+002D (Hyphen-minus) // U+0041 - U+005A (Latin Alphabet: Uppercase) // U+0061 - U+007A (Latin Alphabet: Lowercase) // ----- Latin-1 Supplement ----- @@ -136,7 +137,7 @@ function stringContainsIllegalChars(string: string): boolean { // U+0100 - U+017F (European Latin) // eslint-disable-next-line no-control-regex - return /[^\u0020\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u017F]/g.test( + return /[^\u0020\u002D\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u017F]/g.test( string ) } diff --git a/greg/utils.py b/greg/utils.py index b60d9b948709f913495c86f63fc321e921b0f38f..63e17472a7a7b5fa6cb4af6f9dbc4d4e1ff96ef8 100644 --- a/greg/utils.py +++ b/greg/utils.py @@ -226,6 +226,7 @@ def string_contains_illegal_chars(string: str) -> bool: # Only allow the following characters: # ----- Basic Latin ----- # U+0020 (Space) + # U+002D (Hyphen-minus) # U+0041 - U+005A (Latin Alphabet: Uppercase) # U+0061 - U+007A (Latin Alphabet: Lowercase) # ----- Latin-1 Supplement ----- @@ -237,7 +238,7 @@ def string_contains_illegal_chars(string: str) -> bool: # U+0100 - U+017F (European Latin) return bool( re.search( - r"[^\u0020\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u017F]", + r"[^\u0020\u002D\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u017F]", string, ) )