From c8e9793412ac8207754021a69753ead23a6c29d5 Mon Sep 17 00:00:00 2001 From: nikrou Date: Thu, 9 Feb 2006 20:38:07 +0000 Subject: merge branch 1.5 into trunk r1001:1002: bug 259 fixed git-svn-id: http://piwigo.org/svn/trunk@1030 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_html.inc.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index bff44f620..bee99f92f 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -409,21 +409,25 @@ function get_html_menu_category($categories) function parse_comment_content($content) { $content = nl2br($content); + + $pattern = '/(http?:\/\/\S*)/'; + $replacement = '$1'; + $content = preg_replace($pattern, $replacement, $content); // replace _word_ by an underlined word - $pattern = '/_([^\s]*)_/'; - $replacement = '\1'; + $pattern = '/\b_(\S*)_\b/'; + $replacement = '$1'; $content = preg_replace($pattern, $replacement, $content); // replace *word* by a bolded word - $pattern = '/\*([^\s]*)\*/'; - $replacement = '\1'; + $pattern = '/\b\*(\S*)\*\b/'; + $replacement = '$1'; $content = preg_replace($pattern, $replacement, $content); // replace /word/ by an italic word - $pattern = '/\/([^\s]*)\//'; - $replacement = '\1'; - $content = preg_replace($pattern, $replacement, $content); + $pattern = "/\/(\S*)\/(\s)/"; + $replacement = '$1$2'; + $content = preg_replace($pattern, $replacement, $content); return $content; } -- cgit v1.2.3