This commit is contained in:
Pinga 2025-01-29 15:04:40 +02:00
parent 032d89a9a6
commit 325c0fb235
3 changed files with 9 additions and 2 deletions

View file

@ -409,6 +409,9 @@ class SystemController extends Controller
case 'korean':
$idntable = '/^[가-힣0-9]+$/u';
break;
case 'arabic':
$idntable = '/^(?!-)(?!.*--)[\x{0621}-\x{064A}\x{0660}-\x{0669}\x{0671}-\x{06D3}-]{1,63}(?<!-)$/u';
break;
default:
$idntable = '/^(?!-)(?!.*--)[A-Z0-9-]{1,63}(?<!-)(.(?!-)(?!.*--)[A-Z0-9-]{1,63}(?<!-))*$/i';
break;
@ -983,6 +986,7 @@ class SystemController extends Controller
'/^[а-яА-ЯґҐєЄіІїЇѝЍћЋљЈ]+$/u' => 'Cyrillic',
'/^[ぁ-んァ-ン一-龯々]+$/u' => 'Japanese',
'/^[가-힣]+$/u' => 'Korean',
'/^(?!-)(?!.*--)[\x{0621}-\x{064A}\x{0660}-\x{0669}\x{0671}-\x{06D3}-]{1,63}(?<!-)$/u' => 'Arabic',
];
$idnRegex = $tld['idn_table'];

View file

@ -51,6 +51,7 @@
<option value="cyrillic">{{ __('Cyrillic') }}</option>
<option value="japanese">{{ __('Japanese') }}</option>
<option value="korean">{{ __('Korean') }}</option>
<option value="arabic">{{ __('Arabic') }}</option>
</select>
<small class="form-text text-muted">{{ __('Choose the script type that the TLD will support. Options include ASCII, Cyrillic, Japanese, and Korean.') }}</small>
</div>

View file

@ -33,6 +33,7 @@
'/^[а-яА-ЯґҐєЄіІїЇѝЍћЋљЈ0-9ʼѫѣѭ]+$/u': 'Cyrillic',
'/^[ぁ-んァ-ン一-龯々0-9]+$/u': 'Japanese',
'/^[가-힣0-9]+$/u': 'Korean',
'/^(?!-)(?!.*--)[\u0621-\u064A\u0660-\u0669\u0671-\u06D3-]{1,63}(?<!-)$/u': 'Arabic'
};
const scriptNameToBadgeClass = {
@ -40,6 +41,7 @@
'Cyrillic': 'bg-secondary-lt', // Grey badge for Cyrillic
'Japanese': 'bg-success-lt', // Green badge for Japanese
'Korean': 'bg-danger-lt', // Red badge for Korean
'Arabic': 'bg-teal-lt', // Teal badge for Japanese
// Add more mappings as needed
'Unknown': 'bg-warning-lt' // Yellow badge for Unknown
};