Use whitelist instead
This commit is contained in:
parent
c89c0f32c0
commit
b3c8e4f77e
|
@ -304,8 +304,8 @@
|
|||
const newError = {}
|
||||
if (!external && fieldInfo.name?.startsWith("_")) {
|
||||
newError.name = `Column name cannot start with an underscore.`
|
||||
} else if (fieldInfo.name?.match(/[-!*+?:^"{}()~/[\]\\]/g)) {
|
||||
newError.name = `Illegal character; cannot be: + - ! ( ) { } [ ] ^ " ~ * ? : \\ /`
|
||||
} else if (fieldInfo.name && !fieldInfo.name.match(/^[a-zA-Z0-9\s]*$/g)) {
|
||||
newError.name = `Illegal character; must be alpha-numeric.`
|
||||
} else if (PROHIBITED_COLUMN_NAMES.some(name => fieldInfo.name === name)) {
|
||||
newError.name = `${PROHIBITED_COLUMN_NAMES.join(
|
||||
", "
|
||||
|
|
Loading…
Reference in New Issue