From 872847565c69afe054c8f469731f3c18d0628fc6 Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Fri, 18 Mar 2022 15:32:11 +0100 Subject: [PATCH] encode ampersands with quoted printable encoding --- src/Header/OptimalEncodedHeaderValue.php | 4 ++-- test/Unit/Header/SubjectTest.php | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/Header/OptimalEncodedHeaderValue.php b/src/Header/OptimalEncodedHeaderValue.php index 5abd8b28..0e89425d 100644 --- a/src/Header/OptimalEncodedHeaderValue.php +++ b/src/Header/OptimalEncodedHeaderValue.php @@ -52,8 +52,8 @@ public function __construct(string $value, bool $phrase = false) '=?%s?Q?%s?=', 'UTF-8', \preg_replace( - ['/\?/', '/_/', '/(?assertEquals( + "=?UTF-8?Q?Aaaaaaaaaaa_20_aaaaa_Aaaaaaaaaaa_=E2=80=98Aaaaaaaaaaaaaa_Aaaaaaaa_=26?=\r\n =?UTF-8?Q?_Aaaaaaaaa=E2=80=99?=", + (string)$subject->getValue() + ); + } + /** * @return array */