From: Michael Date: Mon, 22 Jan 2018 22:22:16 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/develop' into bbcode-url-detection X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3b6b67214145d09f79e9519ae368f0de49f7e76c;hp=e2e38fcd510dbcdb245ead7c451f3e3287b26e57;p=friendica.git Merge remote-tracking branch 'upstream/develop' into bbcode-url-detection --- diff --git a/include/bbcode.php b/include/bbcode.php index 281eeeb021..cad7ddc925 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -971,11 +971,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa if (!$forplaintext) { // Autolink feature (thanks to http://code.seebz.net/p/autolink-php/) $autolink_regex = "`([^\]\=\"']|^)(https?\://[^\s<]+[^\s<\.\)])`ism"; - if ($simplehtml != 7) { - $Text = preg_replace($autolink_regex, '$1$2', $Text); - } else { - $Text = preg_replace($autolink_regex, '$1[url]$2[/url]', $Text); - + $autolink_regex = "/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism"; + $Text = preg_replace($autolink_regex, '$1[url]$2[/url]', $Text); + if ($simplehtml == 7) { $Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism", 'bb_style_url', $Text); $Text = preg_replace_callback("/\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[\/url\]/ism", 'bb_style_url', $Text); } @@ -1047,7 +1045,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa $Text = preg_replace($expression, System::baseUrl()."/display/$1", $Text); if ($tryoembed) { - $Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism", $tryoembed_callback, $Text); + // $Text = preg_replace_callback("/\[url\]([$URLSearchString]*)\[\/url\]/ism", $tryoembed_callback, $Text); } $Text = preg_replace("/([#])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",