🔧
This commit is contained in:
16
vendor/symfony/mime/Header/AbstractHeader.php
vendored
16
vendor/symfony/mime/Header/AbstractHeader.php
vendored
@@ -188,6 +188,20 @@ abstract class AbstractHeader implements HeaderInterface
|
||||
$tokens[] = $encodedToken;
|
||||
}
|
||||
|
||||
foreach ($tokens as $i => $token) {
|
||||
// whitespace(s) between 2 encoded tokens
|
||||
if (
|
||||
0 < $i
|
||||
&& isset($tokens[$i + 1])
|
||||
&& preg_match('~^[\t ]+$~', $token)
|
||||
&& $this->tokenNeedsEncoding($tokens[$i - 1])
|
||||
&& $this->tokenNeedsEncoding($tokens[$i + 1])
|
||||
) {
|
||||
$tokens[$i - 1] .= $token.$tokens[$i + 1];
|
||||
array_splice($tokens, $i, 2);
|
||||
}
|
||||
}
|
||||
|
||||
return $tokens;
|
||||
}
|
||||
|
||||
@@ -237,7 +251,7 @@ abstract class AbstractHeader implements HeaderInterface
|
||||
/**
|
||||
* Generate a list of all tokens in the final header.
|
||||
*/
|
||||
protected function toTokens(string $string = null): array
|
||||
protected function toTokens(?string $string = null): array
|
||||
{
|
||||
$string ??= $this->getBodyAsString();
|
||||
|
||||
|
||||
2
vendor/symfony/mime/Header/Headers.php
vendored
2
vendor/symfony/mime/Header/Headers.php
vendored
@@ -190,7 +190,7 @@ final class Headers
|
||||
return array_shift($values);
|
||||
}
|
||||
|
||||
public function all(string $name = null): iterable
|
||||
public function all(?string $name = null): iterable
|
||||
{
|
||||
if (null === $name) {
|
||||
foreach ($this->headers as $name => $collection) {
|
||||
|
||||
@@ -85,7 +85,7 @@ final class ParameterizedHeader extends UnstructuredHeader
|
||||
* This doesn't need to be overridden in theory, but it is for implementation
|
||||
* reasons to prevent potential breakage of attributes.
|
||||
*/
|
||||
protected function toTokens(string $string = null): array
|
||||
protected function toTokens(?string $string = null): array
|
||||
{
|
||||
$tokens = parent::toTokens(parent::getBodyAsString());
|
||||
|
||||
|
||||
2
vendor/symfony/mime/Header/PathHeader.php
vendored
2
vendor/symfony/mime/Header/PathHeader.php
vendored
@@ -57,6 +57,6 @@ final class PathHeader extends AbstractHeader
|
||||
|
||||
public function getBodyAsString(): string
|
||||
{
|
||||
return '<'.$this->address->toString().'>';
|
||||
return '<'.$this->address->getEncodedAddress().'>';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user