Initial Commit

This commit is contained in:
David Stone
2024-11-30 18:24:12 -07:00
commit e8f7955c1c
5432 changed files with 1397750 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
declare (strict_types=1);
namespace WP_Ultimo\Dependencies\LibDNS;
if (\function_exists('idn_to_ascii')) {
function normalize_name(string $label) : string
{
if (\false === ($result = \idn_to_ascii($label, 0, \INTL_IDNA_VARIANT_UTS46))) {
throw new \InvalidArgumentException("Label '{$label}' could not be processed for IDN");
}
return $result;
}
} else {
function normalize_name(string $label) : string
{
if (\preg_match('/[\\x80-\\xff]/', $label)) {
throw new \InvalidArgumentException("Label '{$label}' contains non-ASCII characters and IDN support is not available." . " Verify that ext/intl is installed for IDN support.");
}
return \strtolower($label);
}
}