mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
fix: issue #3504 umlaut encoding
updated slugify middleware to handle umlauts to specification
This commit is contained in:
parent
a44ec015a6
commit
0cd7b6cf7f
@ -2,6 +2,14 @@ import slugify from 'slug'
|
||||
export default async function uniqueSlug(string, isUnique) {
|
||||
const slug = slugify(string || 'anonymous', {
|
||||
lower: true,
|
||||
charmap: {
|
||||
'Ä' : 'ae',
|
||||
'ä' : 'ae',
|
||||
'Ö' : 'oe',
|
||||
'ö' : 'oe',
|
||||
'Ü' : 'ue',
|
||||
'ü' : 'ue',
|
||||
}
|
||||
})
|
||||
if (await isUnique(slug)) return slug
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user