From 13c0c1909fab05acb0be0bfb4bb38f2eef0f00f3 Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Mon, 15 Jan 2024 16:00:48 +0300 Subject: [PATCH] Update Email.php --- webfiori/email/Email.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webfiori/email/Email.php b/webfiori/email/Email.php index 386bbd7..474b021 100644 --- a/webfiori/email/Email.php +++ b/webfiori/email/Email.php @@ -827,6 +827,8 @@ private function setupBeoreTesting() { * @return string The string after its control characters trimmed. */ private function trimControlChars(string $str) : string { - return trim($str, "\x00..\x20"); + $trimmed = trim($str, "\x00..\x20"); + //Removes any invalid line feed. + return preg_replace("/(\s*[\r\n]+\s*|\s+)/", ' ', $trimmed); } }