diff --git a/lib/util.php b/lib/util.php index e5cc780688..b67df923d9 100644 --- a/lib/util.php +++ b/lib/util.php @@ -2611,6 +2611,9 @@ function common_log_delta($comment=null) function common_strip_html($html, $trim=true, $save_whitespace=false) { + // first replace
with \n + $html = preg_replace('/\<(\s*)?br(\s*)?\/?(\s*)?\>/i', "\n", $html); + // then, unless explicitly avoided, remove excessive whitespace if (!$save_whitespace) { $html = preg_replace('/\s+/', ' ', $html); }