From: Friendika Date: Sat, 22 Jan 2011 13:19:53 +0000 (-0800) Subject: linkify naked urls when they are at the beginning of the text X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6c0218563f9d1b88a2adbaaa875558d4c3abea0b;p=friendica.git linkify naked urls when they are at the beginning of the text --- diff --git a/include/bbcode.php b/include/bbcode.php index ef31f5a665..81b581cdbd 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -21,7 +21,8 @@ function bbcode($Text) { // Perform URL Search - $Text = preg_replace("/[^\]\=](https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' $1', $Text); + + $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' $2', $Text); $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '$1', $Text); $Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '$2', $Text);