Update Composer packages
This commit is contained in:
parent
a80f1abaa4
commit
0a904482ae
41 changed files with 922 additions and 679 deletions
20
kirby/vendor/symfony/polyfill-intl-idn/Idn.php
vendored
20
kirby/vendor/symfony/polyfill-intl-idn/Idn.php
vendored
|
@ -280,10 +280,6 @@ final class Idn
|
|||
|
||||
switch ($data['status']) {
|
||||
case 'disallowed':
|
||||
$info->errors |= self::ERROR_DISALLOWED;
|
||||
|
||||
// no break.
|
||||
|
||||
case 'valid':
|
||||
$str .= mb_chr($codePoint, 'utf-8');
|
||||
|
||||
|
@ -294,7 +290,7 @@ final class Idn
|
|||
break;
|
||||
|
||||
case 'mapped':
|
||||
$str .= $data['mapping'];
|
||||
$str .= $transitional && 0x1E9E === $codePoint ? 'ss' : $data['mapping'];
|
||||
|
||||
break;
|
||||
|
||||
|
@ -346,6 +342,18 @@ final class Idn
|
|||
$validationOptions = $options;
|
||||
|
||||
if ('xn--' === substr($label, 0, 4)) {
|
||||
// Step 4.1. If the label contains any non-ASCII code point (i.e., a code point greater than U+007F),
|
||||
// record that there was an error, and continue with the next label.
|
||||
if (preg_match('/[^\x00-\x7F]/', $label)) {
|
||||
$info->errors |= self::ERROR_PUNYCODE;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Step 4.2. Attempt to convert the rest of the label to Unicode according to Punycode [RFC3492]. If
|
||||
// that conversion fails, record that there was an error, and continue
|
||||
// with the next label. Otherwise replace the original label in the string by the results of the
|
||||
// conversion.
|
||||
try {
|
||||
$label = self::punycodeDecode(substr($label, 4));
|
||||
} catch (\Exception $e) {
|
||||
|
@ -516,6 +524,8 @@ final class Idn
|
|||
if ('-' === substr($label, -1, 1)) {
|
||||
$info->errors |= self::ERROR_TRAILING_HYPHEN;
|
||||
}
|
||||
} elseif ('xn--' === substr($label, 0, 4)) {
|
||||
$info->errors |= self::ERROR_PUNYCODE;
|
||||
}
|
||||
|
||||
// Step 4. The label must not contain a U+002E (.) FULL STOP.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue