Old Packages
This commit is contained in:
+74
-70
@@ -23,37 +23,45 @@ use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex;
|
||||
*/
|
||||
final class Idn
|
||||
{
|
||||
const ERROR_EMPTY_LABEL = 1;
|
||||
const ERROR_LABEL_TOO_LONG = 2;
|
||||
const ERROR_DOMAIN_NAME_TOO_LONG = 4;
|
||||
const ERROR_LEADING_HYPHEN = 8;
|
||||
const ERROR_TRAILING_HYPHEN = 0x10;
|
||||
const ERROR_HYPHEN_3_4 = 0x20;
|
||||
const ERROR_LEADING_COMBINING_MARK = 0x40;
|
||||
const ERROR_DISALLOWED = 0x80;
|
||||
const ERROR_PUNYCODE = 0x100;
|
||||
const ERROR_LABEL_HAS_DOT = 0x200;
|
||||
const ERROR_INVALID_ACE_LABEL = 0x400;
|
||||
const ERROR_BIDI = 0x800;
|
||||
const ERROR_CONTEXTJ = 0x1000;
|
||||
const ERROR_CONTEXTO_PUNCTUATION = 0x2000;
|
||||
const ERROR_CONTEXTO_DIGITS = 0x4000;
|
||||
public const ERROR_EMPTY_LABEL = 1;
|
||||
public const ERROR_LABEL_TOO_LONG = 2;
|
||||
public const ERROR_DOMAIN_NAME_TOO_LONG = 4;
|
||||
public const ERROR_LEADING_HYPHEN = 8;
|
||||
public const ERROR_TRAILING_HYPHEN = 0x10;
|
||||
public const ERROR_HYPHEN_3_4 = 0x20;
|
||||
public const ERROR_LEADING_COMBINING_MARK = 0x40;
|
||||
public const ERROR_DISALLOWED = 0x80;
|
||||
public const ERROR_PUNYCODE = 0x100;
|
||||
public const ERROR_LABEL_HAS_DOT = 0x200;
|
||||
public const ERROR_INVALID_ACE_LABEL = 0x400;
|
||||
public const ERROR_BIDI = 0x800;
|
||||
public const ERROR_CONTEXTJ = 0x1000;
|
||||
public const ERROR_CONTEXTO_PUNCTUATION = 0x2000;
|
||||
public const ERROR_CONTEXTO_DIGITS = 0x4000;
|
||||
|
||||
const INTL_IDNA_VARIANT_2003 = 0;
|
||||
const INTL_IDNA_VARIANT_UTS46 = 1;
|
||||
public const INTL_IDNA_VARIANT_2003 = 0;
|
||||
public const INTL_IDNA_VARIANT_UTS46 = 1;
|
||||
|
||||
const MAX_DOMAIN_SIZE = 253;
|
||||
const MAX_LABEL_SIZE = 63;
|
||||
public const IDNA_DEFAULT = 0;
|
||||
public const IDNA_ALLOW_UNASSIGNED = 1;
|
||||
public const IDNA_USE_STD3_RULES = 2;
|
||||
public const IDNA_CHECK_BIDI = 4;
|
||||
public const IDNA_CHECK_CONTEXTJ = 8;
|
||||
public const IDNA_NONTRANSITIONAL_TO_ASCII = 16;
|
||||
public const IDNA_NONTRANSITIONAL_TO_UNICODE = 32;
|
||||
|
||||
const BASE = 36;
|
||||
const TMIN = 1;
|
||||
const TMAX = 26;
|
||||
const SKEW = 38;
|
||||
const DAMP = 700;
|
||||
const INITIAL_BIAS = 72;
|
||||
const INITIAL_N = 128;
|
||||
const DELIMITER = '-';
|
||||
const MAX_INT = 2147483647;
|
||||
public const MAX_DOMAIN_SIZE = 253;
|
||||
public const MAX_LABEL_SIZE = 63;
|
||||
|
||||
public const BASE = 36;
|
||||
public const TMIN = 1;
|
||||
public const TMAX = 26;
|
||||
public const SKEW = 38;
|
||||
public const DAMP = 700;
|
||||
public const INITIAL_BIAS = 72;
|
||||
public const INITIAL_N = 128;
|
||||
public const DELIMITER = '-';
|
||||
public const MAX_INT = 2147483647;
|
||||
|
||||
/**
|
||||
* Contains the numeric value of a basic code point (for use in representing integers) in the
|
||||
@@ -61,7 +69,7 @@ final class Idn
|
||||
*
|
||||
* @var array<int, int>
|
||||
*/
|
||||
private static $basicToDigit = array(
|
||||
private static $basicToDigit = [
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
|
||||
@@ -85,7 +93,7 @@ final class Idn
|
||||
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
);
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array<int, int>
|
||||
@@ -137,32 +145,26 @@ final class Idn
|
||||
*
|
||||
* @return string|false
|
||||
*/
|
||||
public static function idn_to_ascii($domainName, $options = IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = array())
|
||||
public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = [])
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) {
|
||||
@trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', E_USER_DEPRECATED);
|
||||
@trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$options = array(
|
||||
$options = [
|
||||
'CheckHyphens' => true,
|
||||
'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & \IDNA_CHECK_BIDI),
|
||||
'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & \IDNA_CHECK_CONTEXTJ),
|
||||
'UseSTD3ASCIIRules' => 0 !== ($options & \IDNA_USE_STD3_RULES),
|
||||
'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & \IDNA_NONTRANSITIONAL_TO_ASCII),
|
||||
'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI),
|
||||
'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ),
|
||||
'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES),
|
||||
'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_ASCII),
|
||||
'VerifyDnsLength' => true,
|
||||
);
|
||||
];
|
||||
$info = new Info();
|
||||
$labels = self::process((string) $domainName, $options, $info);
|
||||
|
||||
foreach ($labels as $i => $label) {
|
||||
// Only convert labels to punycode that contain non-ASCII code points and only if that
|
||||
// label does not contain a character from the gen-delims set specified in
|
||||
// {@link https://ietf.org/rfc/rfc3987.html#section-2.2}
|
||||
// Only convert labels to punycode that contain non-ASCII code points
|
||||
if (1 === preg_match('/[^\x00-\x7F]/', $label)) {
|
||||
if (false !== strpbrk($label, ':/?#[]@')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
$label = 'xn--'.self::punycodeEncode($label);
|
||||
} catch (Exception $e) {
|
||||
@@ -177,11 +179,11 @@ final class Idn
|
||||
self::validateDomainAndLabelLength($labels, $info);
|
||||
}
|
||||
|
||||
$idna_info = array(
|
||||
$idna_info = [
|
||||
'result' => implode('.', $labels),
|
||||
'isTransitionalDifferent' => $info->transitionalDifferent,
|
||||
'errors' => $info->errors,
|
||||
);
|
||||
];
|
||||
|
||||
return 0 === $info->errors ? $idna_info['result'] : false;
|
||||
}
|
||||
@@ -196,25 +198,25 @@ final class Idn
|
||||
*
|
||||
* @return string|false
|
||||
*/
|
||||
public static function idn_to_utf8($domainName, $options = IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = array())
|
||||
public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = [])
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) {
|
||||
@trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', E_USER_DEPRECATED);
|
||||
@trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
$info = new Info();
|
||||
$labels = self::process((string) $domainName, array(
|
||||
$labels = self::process((string) $domainName, [
|
||||
'CheckHyphens' => true,
|
||||
'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & \IDNA_CHECK_BIDI),
|
||||
'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & \IDNA_CHECK_CONTEXTJ),
|
||||
'UseSTD3ASCIIRules' => 0 !== ($options & \IDNA_USE_STD3_RULES),
|
||||
'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & \IDNA_NONTRANSITIONAL_TO_UNICODE),
|
||||
), $info);
|
||||
$idna_info = array(
|
||||
'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI),
|
||||
'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ),
|
||||
'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES),
|
||||
'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_UNICODE),
|
||||
], $info);
|
||||
$idna_info = [
|
||||
'result' => implode('.', $labels),
|
||||
'isTransitionalDifferent' => $info->transitionalDifferent,
|
||||
'errors' => $info->errors,
|
||||
);
|
||||
];
|
||||
|
||||
return 0 === $info->errors ? $idna_info['result'] : false;
|
||||
}
|
||||
@@ -249,7 +251,7 @@ final class Idn
|
||||
// If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C(Joining_Type:T)*(Joining_Type:{R,D})) Then
|
||||
// True;
|
||||
// Generated RegExp = ([Joining_Type:{L,D}][Joining_Type:T]*\u200C[Joining_Type:T]*)[Joining_Type:{R,D}]
|
||||
if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, PREG_OFFSET_CAPTURE, $offset)) {
|
||||
if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset)) {
|
||||
$offset += \strlen($matches[1][0]);
|
||||
|
||||
continue;
|
||||
@@ -326,7 +328,7 @@ final class Idn
|
||||
if ($checkForEmptyLabels && '' === $domain) {
|
||||
$info->errors |= self::ERROR_EMPTY_LABEL;
|
||||
|
||||
return array($domain);
|
||||
return [$domain];
|
||||
}
|
||||
|
||||
// Step 1. Map each code point in the domain name string
|
||||
@@ -576,7 +578,7 @@ final class Idn
|
||||
$lastDelimIndex = strrpos($input, self::DELIMITER);
|
||||
$b = false === $lastDelimIndex ? 0 : $lastDelimIndex;
|
||||
$inputLength = \strlen($input);
|
||||
$output = array();
|
||||
$output = [];
|
||||
$bytes = array_map('ord', str_split($input));
|
||||
|
||||
for ($j = 0; $j < $b; ++$j) {
|
||||
@@ -642,7 +644,7 @@ final class Idn
|
||||
|
||||
$n += intdiv($i, $outPlusOne);
|
||||
$i %= $outPlusOne;
|
||||
array_splice($output, $i++, 0, array(mb_chr($n, 'utf-8')));
|
||||
array_splice($output, $i++, 0, [mb_chr($n, 'utf-8')]);
|
||||
}
|
||||
|
||||
return implode('', $output);
|
||||
@@ -701,7 +703,9 @@ final class Idn
|
||||
foreach ($iter as $codePoint) {
|
||||
if ($codePoint < $n && 0 === ++$delta) {
|
||||
throw new Exception('Integer overflow');
|
||||
} elseif ($codePoint === $n) {
|
||||
}
|
||||
|
||||
if ($codePoint === $n) {
|
||||
$q = $delta;
|
||||
|
||||
for ($k = self::BASE; /* no condition */; $k += self::BASE) {
|
||||
@@ -791,7 +795,7 @@ final class Idn
|
||||
$lowerBoundary = 0x80;
|
||||
$upperBoundary = 0xBF;
|
||||
$codePoint = 0;
|
||||
$codePoints = array();
|
||||
$codePoints = [];
|
||||
$length = \strlen($input);
|
||||
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
@@ -885,19 +889,19 @@ final class Idn
|
||||
}
|
||||
|
||||
if (isset(self::$mapped[$codePoint])) {
|
||||
return array('status' => 'mapped', 'mapping' => self::$mapped[$codePoint]);
|
||||
return ['status' => 'mapped', 'mapping' => self::$mapped[$codePoint]];
|
||||
}
|
||||
|
||||
if (isset(self::$ignored[$codePoint])) {
|
||||
return array('status' => 'ignored');
|
||||
return ['status' => 'ignored'];
|
||||
}
|
||||
|
||||
if (isset(self::$deviation[$codePoint])) {
|
||||
return array('status' => 'deviation', 'mapping' => self::$deviation[$codePoint]);
|
||||
return ['status' => 'deviation', 'mapping' => self::$deviation[$codePoint]];
|
||||
}
|
||||
|
||||
if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) {
|
||||
return array('status' => 'disallowed');
|
||||
return ['status' => 'disallowed'];
|
||||
}
|
||||
|
||||
$isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]);
|
||||
@@ -910,12 +914,12 @@ final class Idn
|
||||
}
|
||||
|
||||
if ($isDisallowedMapped) {
|
||||
return array('status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]);
|
||||
return ['status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]];
|
||||
}
|
||||
|
||||
return array('status' => $status);
|
||||
return ['status' => $status];
|
||||
}
|
||||
|
||||
return array('status' => 'valid');
|
||||
return ['status' => 'valid'];
|
||||
}
|
||||
}
|
||||
|
||||
+9
-5
@@ -15,6 +15,10 @@ if (extension_loaded('intl')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
return require __DIR__.'/bootstrap80.php';
|
||||
}
|
||||
|
||||
if (!defined('U_IDNA_PROHIBITED_ERROR')) {
|
||||
define('U_IDNA_PROHIBITED_ERROR', 66560);
|
||||
}
|
||||
@@ -124,18 +128,18 @@ if (!defined('IDNA_ERROR_CONTEXTJ')) {
|
||||
define('IDNA_ERROR_CONTEXTJ', 4096);
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID < 70400) {
|
||||
if (\PHP_VERSION_ID < 70400) {
|
||||
if (!function_exists('idn_to_ascii')) {
|
||||
function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); }
|
||||
function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); }
|
||||
}
|
||||
if (!function_exists('idn_to_utf8')) {
|
||||
function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); }
|
||||
function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); }
|
||||
}
|
||||
} else {
|
||||
if (!function_exists('idn_to_ascii')) {
|
||||
function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); }
|
||||
function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); }
|
||||
}
|
||||
if (!function_exists('idn_to_utf8')) {
|
||||
function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); }
|
||||
function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); }
|
||||
}
|
||||
}
|
||||
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Polyfill\Intl\Idn as p;
|
||||
|
||||
if (!defined('U_IDNA_PROHIBITED_ERROR')) {
|
||||
define('U_IDNA_PROHIBITED_ERROR', 66560);
|
||||
}
|
||||
if (!defined('U_IDNA_ERROR_START')) {
|
||||
define('U_IDNA_ERROR_START', 66560);
|
||||
}
|
||||
if (!defined('U_IDNA_UNASSIGNED_ERROR')) {
|
||||
define('U_IDNA_UNASSIGNED_ERROR', 66561);
|
||||
}
|
||||
if (!defined('U_IDNA_CHECK_BIDI_ERROR')) {
|
||||
define('U_IDNA_CHECK_BIDI_ERROR', 66562);
|
||||
}
|
||||
if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) {
|
||||
define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563);
|
||||
}
|
||||
if (!defined('U_IDNA_ACE_PREFIX_ERROR')) {
|
||||
define('U_IDNA_ACE_PREFIX_ERROR', 66564);
|
||||
}
|
||||
if (!defined('U_IDNA_VERIFICATION_ERROR')) {
|
||||
define('U_IDNA_VERIFICATION_ERROR', 66565);
|
||||
}
|
||||
if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) {
|
||||
define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566);
|
||||
}
|
||||
if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) {
|
||||
define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567);
|
||||
}
|
||||
if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) {
|
||||
define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568);
|
||||
}
|
||||
if (!defined('U_IDNA_ERROR_LIMIT')) {
|
||||
define('U_IDNA_ERROR_LIMIT', 66569);
|
||||
}
|
||||
if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) {
|
||||
define('U_STRINGPREP_PROHIBITED_ERROR', 66560);
|
||||
}
|
||||
if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) {
|
||||
define('U_STRINGPREP_UNASSIGNED_ERROR', 66561);
|
||||
}
|
||||
if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) {
|
||||
define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562);
|
||||
}
|
||||
if (!defined('IDNA_DEFAULT')) {
|
||||
define('IDNA_DEFAULT', 0);
|
||||
}
|
||||
if (!defined('IDNA_ALLOW_UNASSIGNED')) {
|
||||
define('IDNA_ALLOW_UNASSIGNED', 1);
|
||||
}
|
||||
if (!defined('IDNA_USE_STD3_RULES')) {
|
||||
define('IDNA_USE_STD3_RULES', 2);
|
||||
}
|
||||
if (!defined('IDNA_CHECK_BIDI')) {
|
||||
define('IDNA_CHECK_BIDI', 4);
|
||||
}
|
||||
if (!defined('IDNA_CHECK_CONTEXTJ')) {
|
||||
define('IDNA_CHECK_CONTEXTJ', 8);
|
||||
}
|
||||
if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) {
|
||||
define('IDNA_NONTRANSITIONAL_TO_ASCII', 16);
|
||||
}
|
||||
if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) {
|
||||
define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32);
|
||||
}
|
||||
if (!defined('INTL_IDNA_VARIANT_UTS46')) {
|
||||
define('INTL_IDNA_VARIANT_UTS46', 1);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_EMPTY_LABEL')) {
|
||||
define('IDNA_ERROR_EMPTY_LABEL', 1);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) {
|
||||
define('IDNA_ERROR_LABEL_TOO_LONG', 2);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) {
|
||||
define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_LEADING_HYPHEN')) {
|
||||
define('IDNA_ERROR_LEADING_HYPHEN', 8);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) {
|
||||
define('IDNA_ERROR_TRAILING_HYPHEN', 16);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_HYPHEN_3_4')) {
|
||||
define('IDNA_ERROR_HYPHEN_3_4', 32);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) {
|
||||
define('IDNA_ERROR_LEADING_COMBINING_MARK', 64);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_DISALLOWED')) {
|
||||
define('IDNA_ERROR_DISALLOWED', 128);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_PUNYCODE')) {
|
||||
define('IDNA_ERROR_PUNYCODE', 256);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) {
|
||||
define('IDNA_ERROR_LABEL_HAS_DOT', 512);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) {
|
||||
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_BIDI')) {
|
||||
define('IDNA_ERROR_BIDI', 2048);
|
||||
}
|
||||
if (!defined('IDNA_ERROR_CONTEXTJ')) {
|
||||
define('IDNA_ERROR_CONTEXTJ', 4096);
|
||||
}
|
||||
|
||||
if (!function_exists('idn_to_ascii')) {
|
||||
function idn_to_ascii(?string $domain, ?int $flags = 0, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); }
|
||||
}
|
||||
if (!function_exists('idn_to_utf8')) {
|
||||
function idn_to_utf8(?string $domain, ?int $flags = 0, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); }
|
||||
}
|
||||
+2
-3
@@ -20,9 +20,8 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=7.1",
|
||||
"symfony/polyfill-intl-normalizer": "^1.10",
|
||||
"symfony/polyfill-php70": "^1.10",
|
||||
"symfony/polyfill-php72": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
@@ -35,7 +34,7 @@
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.18-dev"
|
||||
"dev-main": "1.23-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
|
||||
Reference in New Issue
Block a user