package and depencies
This commit is contained in:
17
vendor/symfony/mime/Encoder/QpEncoder.php
vendored
17
vendor/symfony/mime/Encoder/QpEncoder.php
vendored
@@ -76,7 +76,7 @@ class QpEncoder implements EncoderInterface
|
||||
255 => '=FF',
|
||||
];
|
||||
|
||||
private static $safeMapShare = [];
|
||||
private static array $safeMapShare = [];
|
||||
|
||||
/**
|
||||
* A map of non-encoded ascii characters.
|
||||
@@ -85,7 +85,7 @@ class QpEncoder implements EncoderInterface
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
protected $safeMap = [];
|
||||
protected array $safeMap = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -106,8 +106,6 @@ class QpEncoder implements EncoderInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* Takes an unencoded string and produces a QP encoded string from it.
|
||||
*
|
||||
* QP encoded strings have a maximum line length of 76 characters.
|
||||
@@ -184,12 +182,11 @@ class QpEncoder implements EncoderInterface
|
||||
private function standardize(string $string): string
|
||||
{
|
||||
$string = str_replace(["\t=0D=0A", ' =0D=0A', '=0D=0A'], ["=09\r\n", "=20\r\n", "\r\n"], $string);
|
||||
switch ($end = \ord(substr($string, -1))) {
|
||||
case 0x09:
|
||||
case 0x20:
|
||||
$string = substr_replace($string, self::QP_MAP[$end], -1);
|
||||
}
|
||||
|
||||
return $string;
|
||||
return match ($end = \ord(substr($string, -1))) {
|
||||
0x09,
|
||||
0x20 => substr_replace($string, self::QP_MAP[$end], -1),
|
||||
default => $string,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user