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); } }