From 8d65bdf0bf6f8a042f4df98c8e0b8064c7d6e8d6 Mon Sep 17 00:00:00 2001 From: FreeScout Date: Mon, 11 Nov 2024 04:23:28 -0800 Subject: [PATCH] Fix @fwd forwarding when styles are present in the email body - closes #4333 --- app/Console/Commands/FetchEmails.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/FetchEmails.php b/app/Console/Commands/FetchEmails.php index 2f902ac2f..97e6c97c7 100644 --- a/app/Console/Commands/FetchEmails.php +++ b/app/Console/Commands/FetchEmails.php @@ -729,7 +729,8 @@ public function processMessage($message, $message_id, $mailbox, $mailboxes, $ext && !$user_id && !$is_reply && !$prev_thread // Only if the email has been sent to one mailbox. && count($to) == 1 && count($cc) == 0 - && preg_match("/^[\s]*".self::FWD_AS_CUSTOMER_COMMAND."/su", strtolower(trim(strip_tags($body)))) + // We need to replace also any potential tags. + && preg_match("/^[\s]*".self::FWD_AS_CUSTOMER_COMMAND."/su", strtolower(trim(\Helper::stripTags($body)))) ) { // Try to get "From:" from body. $original_sender = $this->getOriginalSenderFromFwd($body);