From c6bdafb3d081af001148ea743730d6d927b2b9cd Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 24 Feb 2014 18:00:53 +0100 Subject: [PATCH] nl2br so we get proper newlining when publishing \r, \n or \r\n --- lib/util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index 7b75a46784..9f7eac90f9 100644 --- a/lib/util.php +++ b/lib/util.php @@ -832,7 +832,7 @@ function common_find_mentions_raw($text) function common_render_text($text) { - $r = htmlspecialchars($text); + $r = nl2br(htmlspecialchars($text)); $r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r); $r = common_replace_urls_callback($r, 'common_linkify');