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

View File

@ -915,7 +915,7 @@ function getCharacters(unrestricted) {
function sanitizeId(input) { function sanitizeId(input) {
// Remove any non-alphanumeric characters except underscore (_) and hyphen (-) // 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 // Ensure first character is always a letter
if (!/^[a-zA-Z]/.test(sanitized)) { if (!/^[a-zA-Z]/.test(sanitized)) {