fix(server): Add boundary check for editing host name (#1018)

* feat(localization): Add validation prompt for invalid host formats

Add validation for host formats, allowing only IPv4, IPv6, and domain name formats

Add regular expression validation for host format on the server editing page

Update multilingual files to add the invalidHostFormat field

* chore: Update dependent package versions to the latest

* fix(server edit): Update the hostname regular expression to support IPv6 zone identifiers

Modify the regular expression for hostname validation to add support for IPv6 zone identifiers (such as %en0)
This commit is contained in:
GT610
2026-01-22 12:03:08 +08:00
committed by GitHub
parent d14e97485f
commit f47d1e7141
20 changed files with 176 additions and 78 deletions

View File

@@ -854,6 +854,12 @@ abstract class AppLocalizations {
/// **'Invalid'**
String get invalid;
/// No description provided for @invalidHostFormat.
///
/// In en, this message translates to:
/// **'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.'**
String get invalidHostFormat;
/// No description provided for @jumpServer.
///
/// In en, this message translates to:

View File

@@ -420,6 +420,10 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get invalid => 'Ungültig';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Server springen';

View File

@@ -418,6 +418,10 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get invalid => 'Invalid';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Jump server';

View File

@@ -419,6 +419,10 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get invalid => 'Inválido';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Servidor de salto';

View File

@@ -420,6 +420,10 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get invalid => 'Invalide';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Aller au serveur';

View File

@@ -418,6 +418,10 @@ class AppLocalizationsId extends AppLocalizations {
@override
String get invalid => 'Tidak valid';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Lompat server';

View File

@@ -407,6 +407,10 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get invalid => '無効';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'ジャンプサーバー';

View File

@@ -419,6 +419,10 @@ class AppLocalizationsNl extends AppLocalizations {
@override
String get invalid => 'Ongeldig';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Spring naar server';

View File

@@ -418,6 +418,10 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get invalid => 'Inválido';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Servidor de salto';

View File

@@ -419,6 +419,10 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get invalid => 'Недействительный';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'прыжковый сервер';

View File

@@ -418,6 +418,10 @@ class AppLocalizationsTr extends AppLocalizations {
@override
String get invalid => 'Geçersiz';
@override
String get invalidHostFormat =>
'Invalid host format. Only IPv4, IPv6, and domain characters are allowed.';
@override
String get jumpServer => 'Atlama sunucusu';

View File

@@ -420,6 +420,10 @@ class AppLocalizationsUk extends AppLocalizations {
@override
String get invalid => 'Недійсний';
@override
String get invalidHostFormat =>
'Недійсний формат хоста. Дозволено лише символи IPv4, IPv6 та домену.';
@override
String get jumpServer => 'Стрибковий Сервер';

View File

@@ -401,6 +401,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get invalid => '无效';
@override
String get invalidHostFormat => '主机格式无效,仅支持 IPv4、IPv6 和域名字符。';
@override
String get jumpServer => '跳板服务器';
@@ -1380,6 +1383,9 @@ class AppLocalizationsZhTw extends AppLocalizationsZh {
@override
String get invalid => '無效';
@override
String get invalidHostFormat => '主機格式無效,僅支援 IPv4、IPv6 和網域字元。';
@override
String get jumpServer => '跳板伺服器';