mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Merge pull request #2419 from Risenafis/fix-sanitize
Fix non-ASCII name character voice setting
This commit is contained in:
commit
20a23c5e31
@ -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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user