composer update
This commit is contained in:
@@ -24,7 +24,7 @@ final class Base64ContentEncoder extends Base64Encoder implements ContentEncoder
|
||||
throw new \TypeError(sprintf('Method "%s" takes a stream as a first argument.', __METHOD__));
|
||||
}
|
||||
|
||||
$filter = stream_filter_append($stream, 'convert.base64-encode', STREAM_FILTER_READ, [
|
||||
$filter = stream_filter_append($stream, 'convert.base64-encode', \STREAM_FILTER_READ, [
|
||||
'line-length' => 0 >= $maxLineLength || 76 < $maxLineLength ? 76 : $maxLineLength,
|
||||
'line-break-chars' => "\r\n",
|
||||
]);
|
||||
@@ -32,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);
|
||||
}
|
||||
|
||||
@@ -11,16 +11,14 @@
|
||||
|
||||
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 @).
|
||||
* 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
|
||||
*/
|
||||
@@ -28,8 +26,6 @@ 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
|
||||
{
|
||||
@@ -38,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, 0, \INTL_IDNA_VARIANT_UTS46));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user