aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-11-11 20:32:20 -0800
committerFriendika <info@friendika.com>2010-11-11 20:32:20 -0800
commit7db4a0dd2ee631c4b0652e5852b1bb6f5ca50e63 (patch)
tree3b2c764f16027fa4221a8f09e726c54b4558abc4 /include/bbcode.php
parent16ba93a5b14433f5090255999a1958d4bb2ed611 (diff)
downloadvolse-hubzilla-7db4a0dd2ee631c4b0652e5852b1bb6f5ca50e63.tar.gz
volse-hubzilla-7db4a0dd2ee631c4b0652e5852b1bb6f5ca50e63.tar.bz2
volse-hubzilla-7db4a0dd2ee631c4b0652e5852b1bb6f5ca50e63.zip
give orphans a second chance, linkify naked links
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 961494b16..52ca86bc1 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -17,10 +17,15 @@ function bbcode($Text) {
$MAILSearchString = $URLSearchString . " a-zA-Z0-9\.@";
// Perform URL Search
+
+ $Text = preg_replace("/[^\]\=](http\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</a>', $Text);
+ $Text = preg_replace("/[^\]\=](https\:\/\/[a-zA-Z0-9\:\/\-\?\&\.\=\_\~\#\'\%]*)/", ' <a href="$1" >$1</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);
//$Text = preg_replace("(\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $Text);
+
// Perform MAIL Search
$Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '<a href="mailto:$1">$1</a>', $Text);
$Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.+?)\[\/mail\]/", '<a href="mailto:$1">$2</a>', $Text);