updated plugin WP Mail SMTP version 2.4.0

This commit is contained in:
2020-09-25 14:44:17 +00:00
committed by Gitium
parent 4f3d745449
commit 3053837189
673 changed files with 31869 additions and 65613 deletions

View File

@ -0,0 +1,216 @@
<?php
/*
* Copyright (c) 2014 TrueServer B.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Originally forked from
* https://github.com/true/php-punycode/blob/v2.1.1/src/Punycode.php
*/
namespace WPMailSMTP\Vendor\Symfony\Polyfill\Intl\Idn;
/**
* Partial intl implementation in pure PHP.
*
* Implemented:
* - idn_to_ascii - Convert domain name to IDNA ASCII form
* - idn_to_utf8 - Convert domain name from IDNA ASCII to Unicode
*
* @author Renan Gonçalves <renan.saddam@gmail.com>
* @author Sebastian Kroczek <sk@xbug.de>
* @author Dmitry Lukashin <dmitry@lukashin.ru>
* @author Laurent Bassin <laurent@bassin.info>
*
* @internal
*/
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', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
private static $decodeTable = array('a' => 0, 'b' => 1, 'c' => 2, 'd' => 3, 'e' => 4, 'f' => 5, 'g' => 6, 'h' => 7, 'i' => 8, 'j' => 9, 'k' => 10, 'l' => 11, 'm' => 12, 'n' => 13, 'o' => 14, 'p' => 15, 'q' => 16, 'r' => 17, 's' => 18, 't' => 19, 'u' => 20, 'v' => 21, 'w' => 22, 'x' => 23, 'y' => 24, 'z' => 25, '0' => 26, '1' => 27, '2' => 28, '3' => 29, '4' => 30, '5' => 31, '6' => 32, '7' => 33, '8' => 34, '9' => 35);
public static function idn_to_ascii($domain, $options, $variant, &$idna_info = array())
{
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 (self::INTL_IDNA_VARIANT_UTS46 === $variant) {
$domain = \mb_strtolower($domain, 'utf-8');
}
$parts = \explode('.', $domain);
foreach ($parts as $i => &$part) {
if ('' === $part && \count($parts) > 1 + $i) {
return \false;
}
if (\false === ($part = self::encodePart($part))) {
return \false;
}
}
$output = \implode('.', $parts);
$idna_info = array('result' => \strlen($output) > 255 ? \false : $output, 'isTransitionalDifferent' => \false, 'errors' => 0);
return $idna_info['result'];
}
public static function idn_to_utf8($domain, $options, $variant, &$idna_info = array())
{
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);
}
$parts = \explode('.', $domain);
foreach ($parts as &$part) {
$length = \strlen($part);
if ($length < 1 || 63 < $length) {
continue;
}
if (0 !== \strpos($part, 'xn--')) {
continue;
}
$part = \substr($part, 4);
$part = self::decodePart($part);
}
$output = \implode('.', $parts);
$idna_info = array('result' => \strlen($output) > 255 ? \false : $output, 'isTransitionalDifferent' => \false, 'errors' => 0);
return $idna_info['result'];
}
private static function encodePart($input)
{
if (\substr($input, 0, 1) === '-' || \substr($input, -1) === '-') {
return \false;
}
$codePoints = self::listCodePoints($input);
$n = 128;
$bias = 72;
$delta = 0;
$h = $b = \count($codePoints['basic']);
$output = '';
foreach ($codePoints['basic'] as $code) {
$output .= \mb_chr($code, 'utf-8');
}
if ($input === $output) {
return $output;
}
if ($b > 0) {
$output .= '-';
}
$codePoints['nonBasic'] = \array_unique($codePoints['nonBasic']);
\sort($codePoints['nonBasic']);
$i = 0;
$length = \mb_strlen($input, 'utf-8');
while ($h < $length) {
$m = $codePoints['nonBasic'][$i++];
$delta += ($m - $n) * ($h + 1);
$n = $m;
foreach ($codePoints['all'] as $c) {
if ($c < $n || $c < 128) {
++$delta;
}
if ($c === $n) {
$q = $delta;
for ($k = 36;; $k += 36) {
$t = self::calculateThreshold($k, $bias);
if ($q < $t) {
break;
}
$code = $t + ($q - $t) % (36 - $t);
$output .= self::$encodeTable[$code];
$q = ($q - $t) / (36 - $t);
}
$output .= self::$encodeTable[$q];
$bias = self::adapt($delta, $h + 1, $h === $b);
$delta = 0;
++$h;
}
}
++$delta;
++$n;
}
$output = 'xn--' . $output;
return \strlen($output) < 1 || 63 < \strlen($output) ? \false : \strtolower($output);
}
private static function listCodePoints($input)
{
$codePoints = array('all' => array(), 'basic' => array(), 'nonBasic' => array());
$length = \mb_strlen($input, 'utf-8');
for ($i = 0; $i < $length; ++$i) {
$char = \mb_substr($input, $i, 1, 'utf-8');
$code = \mb_ord($char, 'utf-8');
if ($code < 128) {
$codePoints['all'][] = $codePoints['basic'][] = $code;
} else {
$codePoints['all'][] = $codePoints['nonBasic'][] = $code;
}
}
return $codePoints;
}
private static function calculateThreshold($k, $bias)
{
if ($k <= $bias + 1) {
return 1;
}
if ($k >= $bias + 26) {
return 26;
}
return $k - $bias;
}
private static function adapt($delta, $numPoints, $firstTime)
{
$delta = (int) ($firstTime ? $delta / 700 : $delta / 2);
$delta += (int) ($delta / $numPoints);
$k = 0;
while ($delta > 35 * 13) {
$delta = (int) ($delta / 35);
$k = $k + 36;
}
return $k + (int) (36 * $delta / ($delta + 38));
}
private static function decodePart($input)
{
$n = 128;
$i = 0;
$bias = 72;
$output = '';
$pos = \strrpos($input, '-');
if (\false !== $pos) {
$output = \substr($input, 0, $pos++);
} else {
$pos = 0;
}
$outputLength = \strlen($output);
$inputLength = \strlen($input);
while ($pos < $inputLength) {
$oldi = $i;
$w = 1;
for ($k = 36;; $k += 36) {
$digit = self::$decodeTable[$input[$pos++]];
$i += $digit * $w;
$t = self::calculateThreshold($k, $bias);
if ($digit < $t) {
break;
}
$w *= 36 - $t;
}
$bias = self::adapt($i - $oldi, ++$outputLength, 0 === $oldi);
$n = $n + (int) ($i / $outputLength);
$i = $i % $outputLength;
$output = \mb_substr($output, 0, $i, 'utf-8') . \mb_chr($n, 'utf-8') . \mb_substr($output, $i, $outputLength - 1, 'utf-8');
++$i;
}
return $output;
}
}

View File

@ -0,0 +1,19 @@
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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,141 @@
<?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\Intl\Idn as p;
if (extension_loaded('intl')) {
return;
}
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_2003')) {
define('INTL_IDNA_VARIANT_2003', 0);
}
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 (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); }
}
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); }
}
} 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); }
}
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); }
}
}