Validate against non-alphanumeric characters in keys, in TDFs

This commit is contained in:
Nav
2024-10-05 02:18:45 +01:00
parent 675b375da7
commit e1179d960f

View File

@@ -1113,12 +1113,9 @@ class ValidationService
$failures[] = 'Key must contain only lowercase characters';
}
if (str_contains($key, ' ')) {
$failures[] = 'Key contains at least one whitespace';
}
if (str_contains($key, '.')) {
$failures[] = 'Key contains at least one period (".") character';
// The underscore character is the only non-alphanumeric character that is permitted in keys
if (!ctype_alnum(str_replace('_', '', $key))) {
$failures[] = 'Key contains non-alphanumeric characters';
}
return array_map(