aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-01-22 05:19:53 -0800
committerFriendika <info@friendika.com>2011-01-22 05:19:53 -0800
commit6c0218563f9d1b88a2adbaaa875558d4c3abea0b (patch)
treee19bbe248b3f3862732b9d7dcbe286b3186816d4 /include/bbcode.php
parentf278d17910553a5b51b163da7341c6bb22bfdc7b (diff)
downloadvolse-hubzilla-6c0218563f9d1b88a2adbaaa875558d4c3abea0b.tar.gz
volse-hubzilla-6c0218563f9d1b88a2adbaaa875558d4c3abea0b.tar.bz2
volse-hubzilla-6c0218563f9d1b88a2adbaaa875558d4c3abea0b.zip
linkify naked urls when they are at the beginning of the text
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index ef31f5a66..81b581cdb 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\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</a>', $Text);
+
+ $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$2" >$2</a>', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '<a href="$1" >$1</a>', $Text);
$Text = preg_replace("(\[url\=([$URLSearchString]*)\](.+?)\[/url\])", '<a href="$1" >$2</a>', $Text);