mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-17 15:47:14 +00:00
fix(outbound): preserve non-ASCII characters in imported subscription tags (#5354)
SlugRemark stripped every non-ASCII character, so tags generated from remarks like Cyrillic names collapsed to just their digits, making imported outbounds hard to identify. Keep Unicode letters and digits in the slug regex while still collapsing punctuation into dashes.
This commit is contained in:
@@ -59,4 +59,11 @@ func TestSlugAndSuggest(t *testing.T) {
|
||||
if tag != "hk-sg-01" {
|
||||
t.Errorf("suggest tag got %q", tag)
|
||||
}
|
||||
// Non-ASCII letters/digits are preserved rather than stripped.
|
||||
if got := SlugRemark("Москва 🇷🇺 01"); got != "москва-01" {
|
||||
t.Errorf("unicode slug got %q", got)
|
||||
}
|
||||
if got := SuggestTag("ru-", "Сервер 2", 0); got != "ru-сервер-2" {
|
||||
t.Errorf("unicode suggest tag got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user