This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app
megothss c71c107649
FIX: Don't accept accents in slug if generation_method == 'ascii' (#15702)
* FIX: Don't accept accents in slug if generation_method == 'ascii'

Fixes bug reported in:
- https://meta.discourse.org/t/404-when-trying-to-edit-category-with-accent-in-slug/214762
- https://meta.discourse.org/t/formatting-and-accents-in-urls/215734/5

Assuming `SiteSetting.slug_generation_method == 'ascii'.

If the user provides a slug containing non-ascii characters while
creating the category, the user will receive a 404 error just
after saving the category since the slug will be escaped anyway but
Category.find_by_slug_path won't escape the category slug
causing the Edit Page of the category to be inaccessible.

This commit checks the provided slug and raises an error if the
provided slugcontains non-ascii characters ensuring that the
provided value is consistent with the site settings.

It also changes Category.find_by_slug_path to always escape the slug,
since if present, it is escaped anyway in Category.ensure_slug to
prevent the 404 in the Edit Category Page in case the user already
have some category with a non-ascii slug.

* Removed trailing whitespace
2022-02-17 13:46:06 +11:00
..
assets FEATURE: mute subcategory when parent category is muted (#15966) 2022-02-17 00:42:02 +01:00
controllers FEATURE: mute subcategory when parent category is muted (#15966) 2022-02-17 00:42:02 +01:00
helpers FIX: Update application_helper logic now that Ember CLI is default (#15935) 2022-02-14 13:48:18 +00:00
jobs FEATURE: New plugin API to check if upload is used (#15545) 2022-02-16 09:00:30 +02:00
mailers FEATURE: Allow sending group SMTP emails with from alias (#15687) 2022-02-07 13:52:01 +10:00
models FIX: Don't accept accents in slug if generation_method == 'ascii' (#15702) 2022-02-17 13:46:06 +11:00
serializers FEATURE: mute subcategory when parent category is muted (#15966) 2022-02-17 00:42:02 +01:00
services DEV: Add chat_quoted notification type (#15968) 2022-02-16 15:22:08 +10:00
views PERF: Update ember-auto-import and webpack (#15919) 2022-02-14 11:21:39 +00:00