From fa7a0255ea9ed98d27e2386dc6427756b28f06e1 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Wed, 7 May 2014 18:35:20 -0500 Subject: [PATCH] Strip leading and trailing WS from text mails --- include/class.format.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/class.format.php b/include/class.format.php index e48615ff7..96fe09d94 100644 --- a/include/class.format.php +++ b/include/class.format.php @@ -379,9 +379,7 @@ class Format { } function stripEmptyLines($string) { - //return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $string); - //return preg_replace('/\s\s+/',"\n",$string); //Too strict?? - return preg_replace("/\n{3,}/", "\n\n", $string); + return preg_replace("/\n{3,}/", "\n\n", trim($string)); } -- GitLab