New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change regex not letting utf-8 garden names save #1641
Conversation
i like this. Anyone know why we stopped it? Was it just because it goes in the url? |
Possibly? It still seems to work with special characters unless you can find an example where it doesn't. I also need to fix one more test before this is ready |
What happens if you create a garden containing a character which is not allowed in URLs? Is Rails' slug-making algorithm smart enough to escape them? |
If we allow new lines in garden names, what is the consequences? I think just the csv render types -- would we render the new lines on pages? they don't really make sense to me to have a new line in the garden name. |
Looks like it's smart enough to not enter newlines and other breaking things in CSV format (just the actual characters for "\n" etc) and URLs seem fine, but to be safe I added a regex (that also allows utf-8) |
merge when ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What strings do we actually want to allow? I suggest the following characters should be allowed:
- any Unicode letter character
- combining characters
- digits
- most punctuation characters
- spaces
... but no tabs, newlines, DELs, bells, or NULLs. Anything else we want to exclude?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you address the comments from Miles? Then this should be good to go.
Closes #1634
I removed the regex that wasn't letting UTF-8 chars save.