Open ghost opened 10 years ago
7th Feb 2013, Pierre Martin said:
Note: we detected an issue with the previous regex for Attachments slugs. Since their slug seems to be used for filenames it needs at least to allow ".", and maybe more. Further investigation is needed.
10th Feb 2013, Grégory Salvan said:
hi, django framework implements slugs with the rule you've given. I think it's good to keep this rule for slugs.
Why not implementing another rule with the POSIX "fully portable filenames" : "/[-._a-z0-9]+$/i" for attachment slugs ?
10th Feb 2013, Grégory Salvan said:
oups sorry django and rails manages underscores in slugs.
django: https://docs.djangoproject.com/en/dev/ref/models/fields/#slugfield
WordPress function "sanitize_title_with_dashes" may be helpful http://wpseek.com/sanitize_title_with_dashes/
Created by Pierre Martin, 23rd Jan 2013. (originally Lighthouse ticket #342):
So far slugs are not validated server side, so it is possible to save slugs like "my-awesome-page&more" which is incorrect.
This ticket is about adding a validation rule for slugs. I suggest something very simple like :
... or using a more complete regex similar to what is used in the "url" validation rule