diff options
author | zottel <github@zottel.net> | 2012-06-03 14:21:51 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2012-06-03 14:21:51 +0200 |
commit | 70c4ab68754941749a5e89434d6db19f6bba1e16 (patch) | |
tree | 525a6536b6ab7f9020e83daf9287c785303ad584 /include/bbcode.php | |
parent | df2fdf08ddf8cb354022992d4353ced4295b77b3 (diff) | |
parent | daa4f5213f726b22846859f2f12d06889e9bdc9b (diff) | |
download | volse-hubzilla-70c4ab68754941749a5e89434d6db19f6bba1e16.tar.gz volse-hubzilla-70c4ab68754941749a5e89434d6db19f6bba1e16.tar.bz2 volse-hubzilla-70c4ab68754941749a5e89434d6db19f6bba1e16.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 85d310b75..efc362880 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -52,6 +52,8 @@ function bb_unspacefy_and_trim($st) { function bbcode($Text,$preserve_nl = false) { + $a = get_app(); + // Hide all [noparse] contained bbtags spacefying them $Text = preg_replace_callback("/\[noparse\](.*?)\[\/noparse\]/ism", 'bb_spacefy',$Text); @@ -114,6 +116,11 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$1" target="external-link">$2</a>', $Text); //$Text = preg_replace("/\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[\/url\]/ism", '<a href="$1" target="_blank">$2</a>', $Text); + // we may need to restrict this further if it picks up too many strays + // link acct:user@host to a webfinger profile redirector + + $Text = preg_replace('/acct:(.*?)@(.*?)([ ,])/', '<a href="' . $a->get_baseurl() . '/acctlink?addr=' . "$1@$2" + . '" target="extlink" >acct:' . "$1@$2$3" . '</a>',$Text); // Perform MAIL Search $Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '<a href="mailto:$1">$1</a>', $Text); @@ -226,7 +233,7 @@ function bbcode($Text,$preserve_nl = false) { $endlessloop = 0; while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20)) $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", - "<br /><strong class=".'"author"'.">" . $t_wrote . "</strong><blockquote class=".'"author"'.">$2</blockquote>", + "<br /><strong class=".'"author"'.">" . $t_wrote . "</strong><blockquote>$2</blockquote>", $Text); // [img=widthxheight]image source[/img] |