merge master in prod
This commit is contained in:
@@ -43,6 +43,9 @@ namespace Symfony\Polyfill\Intl\Idn;
|
||||
*/
|
||||
final class Idn
|
||||
{
|
||||
const INTL_IDNA_VARIANT_2003 = 0;
|
||||
const INTL_IDNA_VARIANT_UTS46 = 1;
|
||||
|
||||
private static $encodeTable = array(
|
||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
|
||||
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
|
||||
@@ -60,18 +63,18 @@ final class Idn
|
||||
|
||||
public static function idn_to_ascii($domain, $options, $variant, &$idna_info = array())
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 70200 && INTL_IDNA_VARIANT_2003 === $variant) {
|
||||
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);
|
||||
}
|
||||
|
||||
if (INTL_IDNA_VARIANT_UTS46 === $variant) {
|
||||
if (self::INTL_IDNA_VARIANT_UTS46 === $variant) {
|
||||
$domain = mb_strtolower($domain, 'utf-8');
|
||||
}
|
||||
|
||||
$parts = explode('.', $domain);
|
||||
|
||||
foreach ($parts as &$part) {
|
||||
if ('' === $part) {
|
||||
foreach ($parts as $i => &$part) {
|
||||
if ('' === $part && \count($parts) > 1 + $i) {
|
||||
return false;
|
||||
}
|
||||
if (false === $part = self::encodePart($part)) {
|
||||
@@ -92,7 +95,7 @@ final class Idn
|
||||
|
||||
public static function idn_to_utf8($domain, $options, $variant, &$idna_info = array())
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 70200 && INTL_IDNA_VARIANT_2003 === $variant) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2018 Fabien Potencier
|
||||
Copyright (c) 2018-2019 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Symfony Polyfill / Intl: Idn
|
||||
============================
|
||||
|
||||
This component provides `idn_to_ascii` and `idn_to_utf8` functions to users who run php versions without the intl extension.
|
||||
This component provides [`idn_to_ascii`](https://php.net/idn-to-ascii) and [`idn_to_utf8`](https://php.net/idn-to-utf8) functions to users who run php versions without the [Intl](https://php.net/intl) extension.
|
||||
|
||||
More information can be found in the
|
||||
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
use Symfony\Polyfill\Intl\Idn as p;
|
||||
|
||||
if (!function_exists('idn_to_ascii')) {
|
||||
if (!defined('IDNA_DEFAULT')) {
|
||||
define('U_IDNA_PROHIBITED_ERROR', 66560);
|
||||
define('U_IDNA_ERROR_START', 66560);
|
||||
define('U_IDNA_UNASSIGNED_ERROR', 66561);
|
||||
@@ -48,7 +48,9 @@ if (!function_exists('idn_to_ascii')) {
|
||||
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
|
||||
define('IDNA_ERROR_BIDI', 2048);
|
||||
define('IDNA_ERROR_CONTEXTJ', 4096);
|
||||
}
|
||||
|
||||
if (!function_exists('idn_to_ascii')) {
|
||||
if (PHP_VERSION_ID < 70400) {
|
||||
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_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); }
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/polyfill-mbstring": "^1.3",
|
||||
"symfony/polyfill-php72": "^1.9"
|
||||
"symfony/polyfill-php72": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" },
|
||||
@@ -30,7 +30,7 @@
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.9-dev"
|
||||
"dev-master": "1.15-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user