]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
nl2br so we get proper newlining when publishing \r, \n or \r\n
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 24 Feb 2014 17:00:53 +0000 (18:00 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 24 Feb 2014 17:00:53 +0000 (18:00 +0100)
lib/util.php

index 7b75a467843f1c56452c3d1218c76cd166000712..9f7eac90f9a4b560cbcdf623724e9a47884bc327 100644 (file)
@@ -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');