mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-05 17:18:04 +02:00
Much better IDN support, fixes #73
This commit is contained in:
parent
4d57ad71a1
commit
137f8170e2
16 changed files with 235 additions and 60 deletions
|
@ -232,6 +232,10 @@ function validate_label($label, $db) {
|
|||
return 'Failed to fetch domain IDN table';
|
||||
}
|
||||
|
||||
if (strpos($parts['domain'], 'xn--') === 0) {
|
||||
$label = idn_to_utf8($parts['domain'], IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
|
||||
}
|
||||
|
||||
// Check for invalid characters using fetched regex
|
||||
if (!preg_match($idnRegex['idn_table'], $label)) {
|
||||
return 'Invalid domain name format, please review registry policy about accepted labels';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue