From 1778e4a315dd386911d12513d6aa7dc569782f13 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 14 Sep 2011 20:47:49 -0700 Subject: bloody ampersands --- include/bbcode.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index af6c10c44..3886af37d 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -43,7 +43,7 @@ function bbcode($Text,$preserve_nl = false) { // Perform URL Search - $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\%\$\!\+\,]+)/", '$1$2', $Text); + $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/", '$1$2', $Text); $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/m", '$1', $Text); $Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/m", '$2', $Text); @@ -159,7 +159,8 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/\[event\-adjust\](.*?)\[\/event\-adjust\]/ism",'',$Text); } - + // fix any escaped ampersands that may have been converted into links + $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text); call_hooks('bbcode',$Text); -- cgit v1.2.3