🔧
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user