Skip to content
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

Slug generation is broken for most Unicode inputs #188

Open
mqp opened this issue Jun 11, 2019 · 0 comments
Open

Slug generation is broken for most Unicode inputs #188

mqp opened this issue Jun 11, 2019 · 0 comments
Labels

Comments

@mqp
Copy link
Contributor

mqp commented Jun 11, 2019

In our current implementation, when we try to generate slugs for hubs, scenes, and avatars, we generate them based on the name, but the slugification library we use barfs and returns invalid output for inputs that contain Unicode characters outside of a small whitelist. This causes a malformed SQL update, which causes the renaming operation to fail.

You can see someone complaining about the slugifier behavior here: h4cc/slugger#33

To the best of my understanding, it will fail if given as inputs any non-ASCII characters except the ones that are keys in this file, although there might be subtleties that I missed: https://github.com/h4cc/slugger/blob/master/lib/replacements.exs

I suggest killing our dependency on this slugification library and creating slugs by e.g. replacing non-URL-safe-characters in names with dashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants