appwrite: π Bug Report: Some Pattern Input Validation Aren't Working
π Reproduction steps
- Open a modal to create a Database
- Type
Default
for Name - Type in
inv@lid
for Database ID - Click Create
π Expected behavior
Client-side validation should run and the user should see a warning in the modal.
π Actual Behavior
The API request is made and there is a server-side error.
Looking at the console logs, it looks like the pattern is invalid:
Pattern attribute value ^[a-zA-Z0-9][a-zA-Z0-9.-]*$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^[a-zA-Z0-9][a-zA-Z0-9.-]*$/v: Invalid character in character class
You can reproduce this by running:
pattern = String.raw`^[a-zA-Z0-9][a-zA-Z0-9._-]*$`;
r = new RegExp(pattern, 'v');
I think the problem is the patternβs last dash (-
).
Tasks
- src/lib/elements/forms/inputId.svelte by @amanpatel23
- src/lib/elements/forms/inputDomain.svelte
π² Appwrite version
Version 1.3.x
π» Operating system
Linux
𧱠Your Environment
No response
π Have you spent some time to check if this issue has been raised before?
- I checked and didnβt find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 38 (12 by maintainers)
@0xchikku currently working bro
@webAbhi, assigned! Thanks for your interest! Please keep us updated on your progress so that we donβt re-assign this to someone else ππΌ
Cool, do not hesitate to reach out to us on Discord
@Ayushpanditmoto, did you want to work on this?
@webAbhi, we assign on a first come first serve basis so Iβll assign it to you if @Ayushpanditmoto doesnβt want to work on it.