From 6c0218563f9d1b88a2adbaaa875558d4c3abea0b Mon Sep 17 00:00:00 2001 From: Friendika Date: Sat, 22 Jan 2011 05:19:53 -0800 Subject: [PATCH] linkify naked urls when they are at the beginning of the text --- include/bbcode.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);