Hajk icon indicating copy to clipboard operation
Hajk copied to clipboard

Allow underscore in search fields, more

Open jacobwod opened this issue 3 years ago • 1 comments

#1187 made some changes to which fields are considered valid in Admin. Unfortunately we missed some characters. As of now I've identified the underscore as missing, which leads to this:

Skärmavbild 2022-10-13 kl  10 49 43

jacobwod avatar Oct 13 '22 08:10 jacobwod

I was about to settle on this description of SQL standard:

SQL identifiers and key words must begin with a letter (a-z, but also letters with diacritical marks and non-Latin letters) or an underscore (_). Subsequent characters in an identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($).

But then I tried in our PostgreSQL and see what was possible: Skärmavbild 2022-10-13 kl  13 03 56

So in order to ensure compatibility with existing configurations, we should allow more than what I'd expect. Especially since PostgreSQL allows more anyway, so there's a risk folks are using it.

Let's expand our current check to also allow _ and . (dot only in the middle of name - however strange it looks, it seems to be allowed as you can see above).

jacobwod avatar Oct 13 '22 11:10 jacobwod