Skip to content
Snippets Groups Projects
Commit 0454e05a authored by Teah Kaasa Mclean's avatar Teah Kaasa Mclean
Browse files

Added hyphen to allowed characters in valid names

parent ca0d5051
No related branches found
No related tags found
1 merge request!420Fix allowed names
Pipeline #228597 passed
......@@ -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
)
}
......
......@@ -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,
)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment