mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-04 22:13:54 +09:00
Update to laravel 7
This commit is contained in:
@@ -15,8 +15,6 @@ use Symfony\Component\Mime\Exception\AddressEncoderException;
|
||||
|
||||
/**
|
||||
* @author Christian Schmidt
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
interface AddressEncoderInterface
|
||||
{
|
||||
|
||||
@@ -15,8 +15,6 @@ use Symfony\Component\Mime\Exception\RuntimeException;
|
||||
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
final class Base64ContentEncoder extends Base64Encoder implements ContentEncoderInterface
|
||||
{
|
||||
@@ -34,11 +32,8 @@ final class Base64ContentEncoder extends Base64Encoder implements ContentEncoder
|
||||
throw new RuntimeException('Unable to set the base64 content encoder to the filter.');
|
||||
}
|
||||
|
||||
if (stream_get_meta_data($stream)['seekable'] ?? false) {
|
||||
rewind($stream);
|
||||
}
|
||||
while (!feof($stream)) {
|
||||
yield fread($stream, 8192);
|
||||
yield fread($stream, 16372);
|
||||
}
|
||||
stream_filter_remove($filter);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
class Base64Encoder implements EncoderInterface
|
||||
{
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
final class Base64MimeHeaderEncoder extends Base64Encoder implements MimeHeaderEncoderInterface
|
||||
{
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
interface ContentEncoderInterface extends EncoderInterface
|
||||
{
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
final class EightBitContentEncoder implements ContentEncoderInterface
|
||||
{
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
interface EncoderInterface
|
||||
{
|
||||
|
||||
@@ -11,29 +11,21 @@
|
||||
|
||||
namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
use Symfony\Component\Mime\Exception\AddressEncoderException;
|
||||
|
||||
/**
|
||||
* An IDN email address encoder.
|
||||
*
|
||||
* Encodes the domain part of an address using IDN. This is compatible will all
|
||||
* SMTP servers.
|
||||
*
|
||||
* This encoder does not support email addresses with non-ASCII characters in
|
||||
* local-part (the substring before @). To send to such addresses, use
|
||||
* Utf8AddressEncoder together with SmtpUtf8Handler. Your outbound SMTP server must support
|
||||
* the SMTPUTF8 extension.
|
||||
* Note: It leaves the local part as is. In case there are non-ASCII characters
|
||||
* in the local part then it depends on the SMTP Server if this is supported.
|
||||
*
|
||||
* @author Christian Schmidt
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
final class IdnAddressEncoder implements AddressEncoderInterface
|
||||
{
|
||||
/**
|
||||
* Encodes the domain part of an address using IDN.
|
||||
*
|
||||
* @throws AddressEncoderException If local-part contains non-ASCII characters
|
||||
*/
|
||||
public function encodeString(string $address): string
|
||||
{
|
||||
@@ -42,12 +34,8 @@ final class IdnAddressEncoder implements AddressEncoderInterface
|
||||
$local = substr($address, 0, $i);
|
||||
$domain = substr($address, $i + 1);
|
||||
|
||||
if (preg_match('/[^\x00-\x7F]/', $local)) {
|
||||
throw new AddressEncoderException(sprintf('Non-ASCII characters not supported in local-part os "%s".', $address));
|
||||
}
|
||||
|
||||
if (preg_match('/[^\x00-\x7F]/', $domain)) {
|
||||
$address = sprintf('%s@%s', $local, idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46));
|
||||
$address = sprintf('%s@%s', $local, idn_to_ascii($domain, \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, \INTL_IDNA_VARIANT_UTS46));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
interface MimeHeaderEncoderInterface
|
||||
{
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Lars Strojny
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
final class QpContentEncoder implements ContentEncoderInterface
|
||||
{
|
||||
@@ -25,10 +23,6 @@ final class QpContentEncoder implements ContentEncoderInterface
|
||||
}
|
||||
|
||||
// we don't use PHP stream filters here as the content should be small enough
|
||||
if (stream_get_meta_data($stream)['seekable'] ?? false) {
|
||||
rewind($stream);
|
||||
}
|
||||
|
||||
yield $this->encodeString(stream_get_contents($stream), 'utf-8', 0, $maxLineLength);
|
||||
}
|
||||
|
||||
|
||||
10
vendor/symfony/mime/Encoder/QpEncoder.php
vendored
10
vendor/symfony/mime/Encoder/QpEncoder.php
vendored
@@ -15,15 +15,13 @@ use Symfony\Component\Mime\CharacterStream;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
class QpEncoder implements EncoderInterface
|
||||
{
|
||||
/**
|
||||
* Pre-computed QP for HUGE optimization.
|
||||
*/
|
||||
private static $qpMap = [
|
||||
private const QP_MAP = [
|
||||
0 => '=00', 1 => '=01', 2 => '=02', 3 => '=03', 4 => '=04',
|
||||
5 => '=05', 6 => '=06', 7 => '=07', 8 => '=08', 9 => '=09',
|
||||
10 => '=0A', 11 => '=0B', 12 => '=0C', 13 => '=0D', 14 => '=0E',
|
||||
@@ -91,7 +89,7 @@ class QpEncoder implements EncoderInterface
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$id = \get_class($this);
|
||||
$id = static::class;
|
||||
if (!isset(self::$safeMapShare[$id])) {
|
||||
$this->initSafeMap();
|
||||
self::$safeMapShare[$id] = $this->safeMap;
|
||||
@@ -172,7 +170,7 @@ class QpEncoder implements EncoderInterface
|
||||
$ret .= $this->safeMap[$b];
|
||||
++$size;
|
||||
} else {
|
||||
$ret .= self::$qpMap[$b];
|
||||
$ret .= self::QP_MAP[$b];
|
||||
$size += 3;
|
||||
}
|
||||
}
|
||||
@@ -189,7 +187,7 @@ class QpEncoder implements EncoderInterface
|
||||
switch ($end = \ord(substr($string, -1))) {
|
||||
case 0x09:
|
||||
case 0x20:
|
||||
$string = substr_replace($string, self::$qpMap[$end], -1);
|
||||
$string = substr_replace($string, self::QP_MAP[$end], -1);
|
||||
}
|
||||
|
||||
return $string;
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace Symfony\Component\Mime\Encoder;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
final class QpMimeHeaderEncoder extends QpEncoder implements MimeHeaderEncoderInterface
|
||||
{
|
||||
|
||||
@@ -15,8 +15,6 @@ use Symfony\Component\Mime\CharacterStream;
|
||||
|
||||
/**
|
||||
* @author Chris Corbyn
|
||||
*
|
||||
* @experimental in 4.3
|
||||
*/
|
||||
final class Rfc2231Encoder implements EncoderInterface
|
||||
{
|
||||
@@ -39,7 +37,7 @@ final class Rfc2231Encoder implements EncoderInterface
|
||||
|
||||
while (null !== $char = $charStream->read(4)) {
|
||||
$encodedChar = rawurlencode($char);
|
||||
if (0 !== \strlen($currentLine) && \strlen($currentLine.$encodedChar) > $thisLineLength) {
|
||||
if ('' !== $currentLine && \strlen($currentLine.$encodedChar) > $thisLineLength) {
|
||||
$lines[] = '';
|
||||
$currentLine = &$lines[$lineCount++];
|
||||
$thisLineLength = $maxLineLength;
|
||||
|
||||
Reference in New Issue
Block a user