Merge pull request #2419 from Risenafis/fix-sanitize

Fix non-ASCII name character voice setting
This commit is contained in:
Cohee 2024-06-25 16:50:10 +03:00 committed by GitHub
commit 20a23c5e31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -915,7 +915,7 @@ function getCharacters(unrestricted) {
function sanitizeId(input) {
// Remove any non-alphanumeric characters except underscore (_) and hyphen (-)
let sanitized = input.replace(/[^a-zA-Z0-9-_]/g, '');
let sanitized = encodeURIComponent(input).replace(/[^a-zA-Z0-9-_]/g, '');
// Ensure first character is always a letter
if (!/^[a-zA-Z]/.test(sanitized)) {