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

Component Slug Update #4

Closed
lpointet opened this issue Jun 21, 2014 · 1 comment
Closed

Component Slug Update #4

lpointet opened this issue Jun 21, 2014 · 1 comment

Comments

@lpointet
Copy link
Collaborator

Adding a new component is easy. The plugin will take care of the corresponding slug by sanitizing the name, as WordPress is doing for new posts.
Problem is when the user edit a component, they are able to update the slug and then include all sorts of characters, even with accents or special ones. No sanitization will ever occur and this will lead to a broken component.

Maybe the solution is to force slug even when updating a component (user don't have the choice), or force the slug once forever at the creation (it's internal only, so why not?), or simply sanitize again at slug update.

@blupu blupu changed the title Component slog update Component slug update Jun 23, 2014
@blupu blupu changed the title Component slug update Component Slug Update Jun 23, 2014
@blupu blupu added bug and removed bug - critical labels Jun 23, 2014
@mleroi
Copy link
Collaborator

mleroi commented Jun 23, 2014

I automatized ( with sanitize_title_with_dashes(remove_accents($component_label) ) the slug creation from the component label to keep it simple for the user, but as slugs can be used on the app side (functions.js in app themes) to make some conditionnal tests on which component is displayed, I think it's important that the user can still change it if needed.
I think I just forgot to apply :
sanitize_title_with_dashes(remove_accents(trim($data['component_slug'])))
to the slug when updating a component!

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

No branches or pull requests

3 participants