diff --git a/web/lib/text2html.php b/web/lib/text2html.php index 6bea204..25474be 100644 --- a/web/lib/text2html.php +++ b/web/lib/text2html.php @@ -4,7 +4,7 @@ function text2html($text,$ifnoe) { if (is_null($text) || preg_match('#^\s*$#',$text)===1) return $ifnoe; $text=htmlspecialchars($text,ENT_QUOTES|ENT_HTML5,'UTF-8'); - $text=preg_replace('#(https?://.+?)(\n|\s|\W\s|\W\n)#','$1$2',$text); + $text=preg_replace('#(https?://.+?)(\n|\s|$|\W\s|\W\n|\W$)#','$1$2',$text); $text=nl2br($text); return $text; }