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

[5.x] Improve handle and slug validation #9778

Merged
merged 15 commits into from
Mar 25, 2024

Conversation

jesseleite
Copy link
Member

@jesseleite jesseleite commented Mar 22, 2024

Was working on #9632 and noticed that we use alpha_dash validation on our handles. After some discussion, we decided that Statamic 5.0 is a good time to improve our handle and slug validation.

  • Add custom Handle validation rule
  • Add custom Slug validation rule
  • Apply new custom rules throughout codebase
    • We're using alpha_dash for most of our handles and slugs, which is too forgiving with stuff like ---not_handle
  • Maybe you can see if I missed any places, @jasonvarga?

Note: Technically this is a breaking change, in that it is stricter for 5.x than it is for 4.x, which might require users to update handle/slug references throughout their data. Can be mentioned in upgrade guide.

@jesseleite jesseleite marked this pull request as ready for review March 22, 2024 21:47
@jasonvarga jasonvarga merged commit f341037 into master Mar 25, 2024
31 checks passed
@jasonvarga jasonvarga deleted the feature/slug-and-snake-case-rules branch March 25, 2024 15:58
@jesseleite jesseleite mentioned this pull request Apr 5, 2024
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants