Ticket #38 (closed enhancement: fixed)
Sanitizing of slugs
| Reported by: | smerrill | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.6 |
| Component: | Habari Core Software | Version: | SVN |
| Keywords: | Cc: | gsnedders, simon@… |
Description
Moved from GCode Issue #299
Reported by smerrill, Apr 02, 2007
Currently Habari replaces all punctuation with a hyphen when constructing a
slug. For a post titled "April Fool's Follow-up", the resulant slug is
"april-fool-s-follow-up".
I think all punctuation should be stripped from the title before
constructing the slug.
Comment 1 by freakerz, Aug 26, 2007
What's the status on this? Should we strip punctuation using an InputFilter or
Format, or do we leave it as-is and close this issue?
Thanks
Comment 2 by smerrill, Aug 26, 2007
If we have an InputFilter that can strip non-alphanumeric and non-hyphen characters,
let's use it. If we don't have such a filter, let's make one!
Comment 3 by moeffju, Aug 28, 2007
We don't have such a beast yet. We must remember that there are more alphanumeric
characters than just those in ASCII, and users might want to keep those in URLs, too.
This should *probably* be a function of the active locale pack.
For the moment, though, stripping [^a-zA-Z0-9_-] should be fine, though. What do you
think?
Change History
comment:4 Changed 3 years ago by chrismeller
- Milestone changed from 0.5 to 0.6
I believe this has been resolved. Can we get an update?
comment:5 Changed 3 years ago by drzax
- Cc simon@… added
Additionally to removing most punctuation I think it'd be best to prevent multiple hyphens in slugs. I don't want "Habari - a wonderful platform" to turn into "habari---a-wonderful-platform"
comment:6 Changed 3 years ago by rickc
While the multiple hyphens in a row seems to be fixed, punctuation is still being replaced by hyphens. For example, 'April's Fool's Day?: - A Follow-up- -?' becomes 'april-s-fool-s-day-a-follow-up'. The punctuation should be stripped rather than turned into hyphens.
