plugin updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2015-2019 Fabien Potencier
|
||||
Copyright (c) 2015-present 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
|
||||
|
||||
@@ -66,14 +66,14 @@ namespace WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring;
|
||||
*/
|
||||
final class Mbstring
|
||||
{
|
||||
const MB_CASE_FOLD = \PHP_INT_MAX;
|
||||
private static $encodingList = array('ASCII', 'UTF-8');
|
||||
public const MB_CASE_FOLD = \PHP_INT_MAX;
|
||||
private const SIMPLE_CASE_FOLD = [['µ', 'ſ', "ͅ", 'ς', "ϐ", "ϑ", "ϕ", "ϖ", "ϰ", "ϱ", "ϵ", "ẛ", "ι"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "ṡ", 'ι']];
|
||||
private static $encodingList = ['ASCII', 'UTF-8'];
|
||||
private static $language = 'neutral';
|
||||
private static $internalEncoding = 'UTF-8';
|
||||
private static $caseFold = array(array('µ', 'ſ', "ͅ", 'ς', "ϐ", "ϑ", "ϕ", "ϖ", "ϰ", "ϱ", "ϵ", "ẛ", "ι"), array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "ṡ", 'ι'));
|
||||
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
|
||||
{
|
||||
if (\is_array($fromEncoding) || \false !== \strpos($fromEncoding, ',')) {
|
||||
if (\is_array($fromEncoding) || null !== $fromEncoding && \false !== \strpos($fromEncoding, ',')) {
|
||||
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
|
||||
} else {
|
||||
$fromEncoding = self::getEncoding($fromEncoding);
|
||||
@@ -93,7 +93,7 @@ final class Mbstring
|
||||
if ('UTF-8' !== $fromEncoding) {
|
||||
$s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s);
|
||||
}
|
||||
return \preg_replace_callback('/[\\x80-\\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
|
||||
return \preg_replace_callback('/[\\x80-\\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s);
|
||||
}
|
||||
if ('HTML-ENTITIES' === $fromEncoding) {
|
||||
$s = \html_entity_decode($s, \ENT_COMPAT, 'UTF-8');
|
||||
@@ -101,12 +101,11 @@ final class Mbstring
|
||||
}
|
||||
return \iconv($fromEncoding, $toEncoding . '//IGNORE', $s);
|
||||
}
|
||||
public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
|
||||
public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars)
|
||||
{
|
||||
$vars = array(&$a, &$b, &$c, &$d, &$e, &$f);
|
||||
$ok = \true;
|
||||
\array_walk_recursive($vars, function (&$v) use(&$ok, $toEncoding, $fromEncoding) {
|
||||
if (\false === ($v = \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding))) {
|
||||
if (\false === ($v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding))) {
|
||||
$ok = \false;
|
||||
}
|
||||
});
|
||||
@@ -126,7 +125,7 @@ final class Mbstring
|
||||
\trigger_error('mb_decode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (!\is_array($convmap) || !$convmap) {
|
||||
if (!\is_array($convmap) || 80000 > \PHP_VERSION_ID && !$convmap) {
|
||||
return \false;
|
||||
}
|
||||
if (null !== $encoding && !\is_scalar($encoding)) {
|
||||
@@ -157,7 +156,7 @@ final class Mbstring
|
||||
$c = isset($m[2]) ? (int) \hexdec($m[2]) : $m[1];
|
||||
for ($i = 0; $i < $cnt; $i += 4) {
|
||||
if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) {
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_chr($c - $convmap[$i + 2]);
|
||||
return self::mb_chr($c - $convmap[$i + 2]);
|
||||
}
|
||||
}
|
||||
return $m[0];
|
||||
@@ -173,7 +172,7 @@ final class Mbstring
|
||||
\trigger_error('mb_encode_numericentity() expects parameter 1 to be string, ' . \gettype($s) . ' given', \E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (!\is_array($convmap) || !$convmap) {
|
||||
if (!\is_array($convmap) || 80000 > \PHP_VERSION_ID && !$convmap) {
|
||||
return \false;
|
||||
}
|
||||
if (null !== $encoding && !\is_scalar($encoding)) {
|
||||
@@ -198,7 +197,7 @@ final class Mbstring
|
||||
} else {
|
||||
$s = \iconv($encoding, 'UTF-8//IGNORE', $s);
|
||||
}
|
||||
static $ulenMask = array("<EFBFBD>" => 2, "<EFBFBD>" => 2, "<EFBFBD>" => 3, "<EFBFBD>" => 4);
|
||||
static $ulenMask = ["<EFBFBD>" => 2, "<EFBFBD>" => 2, "<EFBFBD>" => 3, "<EFBFBD>" => 4];
|
||||
$cnt = \floor(\count($convmap) / 4) * 4;
|
||||
$i = 0;
|
||||
$len = \strlen($s);
|
||||
@@ -242,7 +241,7 @@ final class Mbstring
|
||||
if (null === $titleRegexp) {
|
||||
$titleRegexp = self::getData('titleCaseRegexp');
|
||||
}
|
||||
$s = \preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s);
|
||||
$s = \preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s);
|
||||
} else {
|
||||
if (\MB_CASE_UPPER == $mode) {
|
||||
static $upper = null;
|
||||
@@ -252,7 +251,11 @@ final class Mbstring
|
||||
$map = $upper;
|
||||
} else {
|
||||
if (self::MB_CASE_FOLD === $mode) {
|
||||
$s = \str_replace(self::$caseFold[0], self::$caseFold[1], $s);
|
||||
static $caseFolding = null;
|
||||
if (null === $caseFolding) {
|
||||
$caseFolding = self::getData('caseFolding');
|
||||
}
|
||||
$s = \strtr($s, $caseFolding);
|
||||
}
|
||||
static $lower = null;
|
||||
if (null === $lower) {
|
||||
@@ -260,7 +263,7 @@ final class Mbstring
|
||||
}
|
||||
$map = $lower;
|
||||
}
|
||||
static $ulenMask = array("<EFBFBD>" => 2, "<EFBFBD>" => 2, "<EFBFBD>" => 3, "<EFBFBD>" => 4);
|
||||
static $ulenMask = ["<EFBFBD>" => 2, "<EFBFBD>" => 2, "<EFBFBD>" => 3, "<EFBFBD>" => 4];
|
||||
$i = 0;
|
||||
$len = \strlen($s);
|
||||
while ($i < $len) {
|
||||
@@ -293,48 +296,69 @@ final class Mbstring
|
||||
if (null === $encoding) {
|
||||
return self::$internalEncoding;
|
||||
}
|
||||
$encoding = self::getEncoding($encoding);
|
||||
if ('UTF-8' === $encoding || \false !== @\iconv($encoding, $encoding, ' ')) {
|
||||
self::$internalEncoding = $encoding;
|
||||
$normalizedEncoding = self::getEncoding($encoding);
|
||||
if ('UTF-8' === $normalizedEncoding || \false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) {
|
||||
self::$internalEncoding = $normalizedEncoding;
|
||||
return \true;
|
||||
}
|
||||
return \false;
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
return \false;
|
||||
}
|
||||
throw new \ValueError(\sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
public static function mb_language($lang = null)
|
||||
{
|
||||
if (null === $lang) {
|
||||
return self::$language;
|
||||
}
|
||||
switch ($lang = \strtolower($lang)) {
|
||||
switch ($normalizedLang = \strtolower($lang)) {
|
||||
case 'uni':
|
||||
case 'neutral':
|
||||
self::$language = $lang;
|
||||
self::$language = $normalizedLang;
|
||||
return \true;
|
||||
}
|
||||
return \false;
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
return \false;
|
||||
}
|
||||
throw new \ValueError(\sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang));
|
||||
}
|
||||
public static function mb_list_encodings()
|
||||
{
|
||||
return array('UTF-8');
|
||||
return ['UTF-8'];
|
||||
}
|
||||
public static function mb_encoding_aliases($encoding)
|
||||
{
|
||||
switch (\strtoupper($encoding)) {
|
||||
case 'UTF8':
|
||||
case 'UTF-8':
|
||||
return array('utf8');
|
||||
return ['utf8'];
|
||||
}
|
||||
return \false;
|
||||
}
|
||||
public static function mb_check_encoding($var = null, $encoding = null)
|
||||
{
|
||||
if (\PHP_VERSION_ID < 70200 && \is_array($var)) {
|
||||
\trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if (null === $encoding) {
|
||||
if (null === $var) {
|
||||
return \false;
|
||||
}
|
||||
$encoding = self::$internalEncoding;
|
||||
}
|
||||
return self::mb_detect_encoding($var, array($encoding)) || \false !== @\iconv($encoding, $encoding, $var);
|
||||
if (!\is_array($var)) {
|
||||
return self::mb_detect_encoding($var, [$encoding]) || \false !== @\iconv($encoding, $encoding, $var);
|
||||
}
|
||||
foreach ($var as $key => $value) {
|
||||
if (!self::mb_check_encoding($key, $encoding)) {
|
||||
return \false;
|
||||
}
|
||||
if (!self::mb_check_encoding($value, $encoding)) {
|
||||
return \false;
|
||||
}
|
||||
}
|
||||
return \true;
|
||||
}
|
||||
public static function mb_detect_encoding($str, $encodingList = null, $strict = \false)
|
||||
{
|
||||
@@ -407,8 +431,11 @@ final class Mbstring
|
||||
}
|
||||
$needle = (string) $needle;
|
||||
if ('' === $needle) {
|
||||
\trigger_error(__METHOD__ . ': Empty delimiter', \E_USER_WARNING);
|
||||
return \false;
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
\trigger_error(__METHOD__ . ': Empty delimiter', \E_USER_WARNING);
|
||||
return \false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return \iconv_strpos($haystack, $needle, $offset, $encoding);
|
||||
}
|
||||
@@ -430,7 +457,7 @@ final class Mbstring
|
||||
$haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
|
||||
}
|
||||
}
|
||||
$pos = \iconv_strrpos($haystack, $needle, $encoding);
|
||||
$pos = '' !== $needle || 80000 > \PHP_VERSION_ID ? \iconv_strrpos($haystack, $needle, $encoding) : self::mb_strlen($haystack, $encoding);
|
||||
return \false !== $pos ? $offset + $pos : \false;
|
||||
}
|
||||
public static function mb_str_split($string, $split_length = 1, $encoding = null)
|
||||
@@ -440,8 +467,11 @@ final class Mbstring
|
||||
return null;
|
||||
}
|
||||
if (1 > ($split_length = (int) $split_length)) {
|
||||
\trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING);
|
||||
return \false;
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
\trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING);
|
||||
return \false;
|
||||
}
|
||||
throw new \ValueError('Argument #2 ($length) must be greater than 0');
|
||||
}
|
||||
if (null === $encoding) {
|
||||
$encoding = \mb_internal_encoding();
|
||||
@@ -453,9 +483,9 @@ final class Mbstring
|
||||
$split_length -= 65535;
|
||||
}
|
||||
$rx .= '.{' . $split_length . '})/us';
|
||||
return \preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
|
||||
return \preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
$result = array();
|
||||
$result = [];
|
||||
$length = \mb_strlen($string, $encoding);
|
||||
for ($i = 0; $i < $length; $i += $split_length) {
|
||||
$result[] = \mb_substr($string, $i, $split_length, $encoding);
|
||||
@@ -472,10 +502,19 @@ final class Mbstring
|
||||
}
|
||||
public static function mb_substitute_character($c = null)
|
||||
{
|
||||
if (null === $c) {
|
||||
return 'none';
|
||||
}
|
||||
if (0 === \strcasecmp($c, 'none')) {
|
||||
return \true;
|
||||
}
|
||||
return null !== $c ? \false : 'none';
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
return \false;
|
||||
}
|
||||
if (\is_int($c) || 'long' === $c || 'entity' === $c) {
|
||||
return \false;
|
||||
}
|
||||
throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint');
|
||||
}
|
||||
public static function mb_substr($s, $start, $length = null, $encoding = null)
|
||||
{
|
||||
@@ -501,8 +540,7 @@ final class Mbstring
|
||||
}
|
||||
public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
|
||||
{
|
||||
$haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
|
||||
$needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
|
||||
[$haystack, $needle] = \str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding)]);
|
||||
return self::mb_strpos($haystack, $needle, $offset, $encoding);
|
||||
}
|
||||
public static function mb_stristr($haystack, $needle, $part = \false, $encoding = null)
|
||||
@@ -529,8 +567,10 @@ final class Mbstring
|
||||
}
|
||||
public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
|
||||
{
|
||||
$haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
|
||||
$needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
|
||||
$haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding);
|
||||
$needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding);
|
||||
$haystack = \str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack);
|
||||
$needle = \str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle);
|
||||
return self::mb_strrpos($haystack, $needle, $offset, $encoding);
|
||||
}
|
||||
public static function mb_strstr($haystack, $needle, $part = \false, $encoding = null)
|
||||
@@ -546,7 +586,7 @@ final class Mbstring
|
||||
}
|
||||
public static function mb_get_info($type = 'all')
|
||||
{
|
||||
$info = array('internal_encoding' => self::$internalEncoding, 'http_output' => 'pass', 'http_output_conv_mimetypes' => '^(text/|application/xhtml\\+xml)', 'func_overload' => 0, 'func_overload_list' => 'no overload', 'mail_charset' => 'UTF-8', 'mail_header_encoding' => 'BASE64', 'mail_body_encoding' => 'BASE64', 'illegal_chars' => 0, 'encoding_translation' => 'Off', 'language' => self::$language, 'detect_order' => self::$encodingList, 'substitute_character' => 'none', 'strict_detection' => 'Off');
|
||||
$info = ['internal_encoding' => self::$internalEncoding, 'http_output' => 'pass', 'http_output_conv_mimetypes' => '^(text/|application/xhtml\\+xml)', 'func_overload' => 0, 'func_overload_list' => 'no overload', 'mail_charset' => 'UTF-8', 'mail_header_encoding' => 'BASE64', 'mail_body_encoding' => 'BASE64', 'illegal_chars' => 0, 'encoding_translation' => 'Off', 'language' => self::$language, 'detect_order' => self::$encodingList, 'substitute_character' => 'none', 'strict_detection' => 'Off'];
|
||||
if ('all' === $type) {
|
||||
return $info;
|
||||
}
|
||||
@@ -616,6 +656,41 @@ final class Mbstring
|
||||
}
|
||||
return $code;
|
||||
}
|
||||
public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null) : string
|
||||
{
|
||||
if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], \true)) {
|
||||
throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH');
|
||||
}
|
||||
if (null === $encoding) {
|
||||
$encoding = self::mb_internal_encoding();
|
||||
}
|
||||
try {
|
||||
$validEncoding = @self::mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(\sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(\sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
if (self::mb_strlen($pad_string, $encoding) <= 0) {
|
||||
throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string');
|
||||
}
|
||||
$paddingRequired = $length - self::mb_strlen($string, $encoding);
|
||||
if ($paddingRequired < 1) {
|
||||
return $string;
|
||||
}
|
||||
switch ($pad_type) {
|
||||
case \STR_PAD_LEFT:
|
||||
return self::mb_substr(\str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding) . $string;
|
||||
case \STR_PAD_RIGHT:
|
||||
return $string . self::mb_substr(\str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding);
|
||||
default:
|
||||
$leftPaddingLength = \floor($paddingRequired / 2);
|
||||
$rightPaddingLength = $paddingRequired - $leftPaddingLength;
|
||||
return self::mb_substr(\str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding) . $string . self::mb_substr(\str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding);
|
||||
}
|
||||
}
|
||||
private static function getSubpart($pos, $part, $haystack, $encoding)
|
||||
{
|
||||
if (\false === $pos) {
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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 WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring as p;
|
||||
|
||||
if (!function_exists('mb_convert_variables')) {
|
||||
/**
|
||||
* Convert character code in variable(s)
|
||||
*/
|
||||
function mb_convert_variables($to_encoding, $from_encoding, &$var, &...$vars)
|
||||
{
|
||||
$vars = [&$var, ...$vars];
|
||||
|
||||
$ok = true;
|
||||
array_walk_recursive($vars, function (&$v) use (&$ok, $to_encoding, $from_encoding) {
|
||||
if (false === $v = p\Mbstring::mb_convert_encoding($v, $to_encoding, $from_encoding)) {
|
||||
$ok = false;
|
||||
}
|
||||
});
|
||||
|
||||
return $ok ? $from_encoding : false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Vendor;
|
||||
|
||||
return ['İ' => 'i̇', 'µ' => 'μ', 'ſ' => 's', 'ͅ' => 'ι', 'ς' => 'σ', 'ϐ' => 'β', 'ϑ' => 'θ', 'ϕ' => 'φ', 'ϖ' => 'π', 'ϰ' => 'κ', 'ϱ' => 'ρ', 'ϵ' => 'ε', 'ẛ' => 'ṡ', 'ι' => 'ι', 'ß' => 'ss', 'ʼn' => 'ʼn', 'ǰ' => 'ǰ', 'ΐ' => 'ΐ', 'ΰ' => 'ΰ', 'և' => 'եւ', 'ẖ' => 'ẖ', 'ẗ' => 'ẗ', 'ẘ' => 'ẘ', 'ẙ' => 'ẙ', 'ẚ' => 'aʾ', 'ẞ' => 'ss', 'ὐ' => 'ὐ', 'ὒ' => 'ὒ', 'ὔ' => 'ὔ', 'ὖ' => 'ὖ', 'ᾀ' => 'ἀι', 'ᾁ' => 'ἁι', 'ᾂ' => 'ἂι', 'ᾃ' => 'ἃι', 'ᾄ' => 'ἄι', 'ᾅ' => 'ἅι', 'ᾆ' => 'ἆι', 'ᾇ' => 'ἇι', 'ᾈ' => 'ἀι', 'ᾉ' => 'ἁι', 'ᾊ' => 'ἂι', 'ᾋ' => 'ἃι', 'ᾌ' => 'ἄι', 'ᾍ' => 'ἅι', 'ᾎ' => 'ἆι', 'ᾏ' => 'ἇι', 'ᾐ' => 'ἠι', 'ᾑ' => 'ἡι', 'ᾒ' => 'ἢι', 'ᾓ' => 'ἣι', 'ᾔ' => 'ἤι', 'ᾕ' => 'ἥι', 'ᾖ' => 'ἦι', 'ᾗ' => 'ἧι', 'ᾘ' => 'ἠι', 'ᾙ' => 'ἡι', 'ᾚ' => 'ἢι', 'ᾛ' => 'ἣι', 'ᾜ' => 'ἤι', 'ᾝ' => 'ἥι', 'ᾞ' => 'ἦι', 'ᾟ' => 'ἧι', 'ᾠ' => 'ὠι', 'ᾡ' => 'ὡι', 'ᾢ' => 'ὢι', 'ᾣ' => 'ὣι', 'ᾤ' => 'ὤι', 'ᾥ' => 'ὥι', 'ᾦ' => 'ὦι', 'ᾧ' => 'ὧι', 'ᾨ' => 'ὠι', 'ᾩ' => 'ὡι', 'ᾪ' => 'ὢι', 'ᾫ' => 'ὣι', 'ᾬ' => 'ὤι', 'ᾭ' => 'ὥι', 'ᾮ' => 'ὦι', 'ᾯ' => 'ὧι', 'ᾲ' => 'ὰι', 'ᾳ' => 'αι', 'ᾴ' => 'άι', 'ᾶ' => 'ᾶ', 'ᾷ' => 'ᾶι', 'ᾼ' => 'αι', 'ῂ' => 'ὴι', 'ῃ' => 'ηι', 'ῄ' => 'ήι', 'ῆ' => 'ῆ', 'ῇ' => 'ῆι', 'ῌ' => 'ηι', 'ῒ' => 'ῒ', 'ῖ' => 'ῖ', 'ῗ' => 'ῗ', 'ῢ' => 'ῢ', 'ῤ' => 'ῤ', 'ῦ' => 'ῦ', 'ῧ' => 'ῧ', 'ῲ' => 'ὼι', 'ῳ' => 'ωι', 'ῴ' => 'ώι', 'ῶ' => 'ῶ', 'ῷ' => 'ῶι', 'ῼ' => 'ωι', 'ff' => 'ff', 'fi' => 'fi', 'fl' => 'fl', 'ffi' => 'ffi', 'ffl' => 'ffl', 'ſt' => 'st', 'st' => 'st', 'ﬓ' => 'մն', 'ﬔ' => 'մե', 'ﬕ' => 'մի', 'ﬖ' => 'վն', 'ﬗ' => 'մխ'];
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,6 +11,10 @@
|
||||
|
||||
use WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring as p;
|
||||
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
return require __DIR__.'/bootstrap80.php';
|
||||
}
|
||||
|
||||
if (!function_exists('mb_convert_encoding')) {
|
||||
function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
|
||||
}
|
||||
@@ -18,7 +22,7 @@ if (!function_exists('mb_decode_mimeheader')) {
|
||||
function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
|
||||
}
|
||||
if (!function_exists('mb_encode_mimeheader')) {
|
||||
function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
|
||||
function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
|
||||
}
|
||||
if (!function_exists('mb_decode_numericentity')) {
|
||||
function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
|
||||
@@ -51,7 +55,7 @@ if (!function_exists('mb_detect_order')) {
|
||||
function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_parse_str')) {
|
||||
function mb_parse_str($string, &$result = array()) { parse_str($string, $result); }
|
||||
function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
|
||||
}
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
|
||||
@@ -108,13 +112,11 @@ if (!function_exists('mb_output_handler')) {
|
||||
function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
|
||||
}
|
||||
if (!function_exists('mb_http_input')) {
|
||||
function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
|
||||
function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
require_once __DIR__.'/Resources/mb_convert_variables.php8';
|
||||
} elseif (!function_exists('mb_convert_variables')) {
|
||||
function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); }
|
||||
if (!function_exists('mb_convert_variables')) {
|
||||
function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ord')) {
|
||||
@@ -130,6 +132,10 @@ if (!function_exists('mb_str_split')) {
|
||||
function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_str_pad')) {
|
||||
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
|
||||
}
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
|
||||
namespace WPMailSMTP\Vendor;
|
||||
|
||||
/*
|
||||
* 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 WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring as p;
|
||||
if (!\function_exists('mb_convert_encoding')) {
|
||||
function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null) : array|string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_decode_mimeheader')) {
|
||||
function mb_decode_mimeheader(?string $string) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_decode_mimeheader((string) $string);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_encode_mimeheader')) {
|
||||
function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_decode_numericentity')) {
|
||||
function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_encode_numericentity')) {
|
||||
function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = \false) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_convert_case')) {
|
||||
function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_internal_encoding')) {
|
||||
function mb_internal_encoding(?string $encoding = null) : string|bool
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_internal_encoding($encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_language')) {
|
||||
function mb_language(?string $language = null) : string|bool
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_language($language);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_list_encodings')) {
|
||||
function mb_list_encodings() : array
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_list_encodings();
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_encoding_aliases')) {
|
||||
function mb_encoding_aliases(?string $encoding) : array
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_encoding_aliases((string) $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_check_encoding')) {
|
||||
function mb_check_encoding(array|string|null $value = null, ?string $encoding = null) : bool
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_check_encoding($value, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_detect_encoding')) {
|
||||
function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = \false) : string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_detect_order')) {
|
||||
function mb_detect_order(array|string|null $encoding = null) : array|bool
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_detect_order($encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_parse_str')) {
|
||||
function mb_parse_str(?string $string, &$result = []) : bool
|
||||
{
|
||||
\parse_str((string) $string, $result);
|
||||
return (bool) $result;
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strlen')) {
|
||||
function mb_strlen(?string $string, ?string $encoding = null) : int
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strlen((string) $string, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strpos')) {
|
||||
function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null) : int|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strtolower')) {
|
||||
function mb_strtolower(?string $string, ?string $encoding = null) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strtolower((string) $string, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strtoupper')) {
|
||||
function mb_strtoupper(?string $string, ?string $encoding = null) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strtoupper((string) $string, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_substitute_character')) {
|
||||
function mb_substitute_character(string|int|null $substitute_character = null) : string|int|bool
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_substitute_character($substitute_character);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_substr')) {
|
||||
function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_stripos')) {
|
||||
function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null) : int|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_stristr')) {
|
||||
function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = \false, ?string $encoding = null) : string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strrchr')) {
|
||||
function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = \false, ?string $encoding = null) : string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strrichr')) {
|
||||
function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = \false, ?string $encoding = null) : string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strripos')) {
|
||||
function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null) : int|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strrpos')) {
|
||||
function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null) : int|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strstr')) {
|
||||
function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = \false, ?string $encoding = null) : string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_get_info')) {
|
||||
function mb_get_info(?string $type = 'all') : array|string|int|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_get_info((string) $type);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_http_output')) {
|
||||
function mb_http_output(?string $encoding = null) : string|bool
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_http_output($encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_strwidth')) {
|
||||
function mb_strwidth(?string $string, ?string $encoding = null) : int
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_strwidth((string) $string, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_substr_count')) {
|
||||
function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null) : int
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_output_handler')) {
|
||||
function mb_output_handler(?string $string, ?int $status) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_output_handler((string) $string, (int) $status);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_http_input')) {
|
||||
function mb_http_input(?string $type = null) : array|string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_http_input($type);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_convert_variables')) {
|
||||
function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars) : string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_ord')) {
|
||||
function mb_ord(?string $string, ?string $encoding = null) : int|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_ord((string) $string, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_chr')) {
|
||||
function mb_chr(?int $codepoint, ?string $encoding = null) : string|false
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_chr((int) $codepoint, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_scrub')) {
|
||||
function mb_scrub(?string $string, ?string $encoding = null) : string
|
||||
{
|
||||
$encoding ??= \mb_internal_encoding();
|
||||
return \mb_convert_encoding((string) $string, $encoding, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('mb_str_split')) {
|
||||
function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null) : array
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_str_split((string) $string, (int) $length, $encoding);
|
||||
}
|
||||
}
|
||||
if (!\function_exists('WPMailSMTP\\Vendor\\mb_str_pad')) {
|
||||
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null) : string
|
||||
{
|
||||
return \WPMailSMTP\Vendor\Symfony\Polyfill\Mbstring\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding);
|
||||
}
|
||||
}
|
||||
if (\extension_loaded('mbstring')) {
|
||||
return;
|
||||
}
|
||||
if (!\defined('MB_CASE_UPPER')) {
|
||||
\define('MB_CASE_UPPER', 0);
|
||||
}
|
||||
if (!\defined('MB_CASE_LOWER')) {
|
||||
\define('MB_CASE_LOWER', 1);
|
||||
}
|
||||
if (!\defined('MB_CASE_TITLE')) {
|
||||
\define('MB_CASE_TITLE', 2);
|
||||
}
|
||||
Reference in New Issue
Block a user