aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-02 18:05:23 -0700
committerfriendica <info@friendica.com>2012-06-02 18:05:23 -0700
commit4978ee12d10a9a18f9fc26795e09515ef6db7949 (patch)
treec13226f751abf22be3a835ba32145b96bcc922fc /include
parent608d424b0b94eacd99ceeeca3e2caf112abd5b48 (diff)
downloadvolse-hubzilla-4978ee12d10a9a18f9fc26795e09515ef6db7949.tar.gz
volse-hubzilla-4978ee12d10a9a18f9fc26795e09515ef6db7949.tar.bz2
volse-hubzilla-4978ee12d10a9a18f9fc26795e09515ef6db7949.zip
webfinger profile linker
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php7
-rw-r--r--include/text.php1
2 files changed, 8 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index ba4863de1..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);
diff --git a/include/text.php b/include/text.php
index 376ac473d..d4a4d5580 100644
--- a/include/text.php
+++ b/include/text.php
@@ -891,6 +891,7 @@ function prepare_body($item,$attach = false) {
} else
$s = prepare_text($item['body']);
+
$prep_arr = array('item' => $item, 'html' => $s);
call_hooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];