aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php1
-rwxr-xr-xinclude/items.php25
2 files changed, 25 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 44bde9acb..7a1e3a5e8 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -268,7 +268,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/$urlchars+)/ism", '$1<a href="$2" >$2</a>', $Text);
-// $Text = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/$urlchars+)\{zid\}($urlchars*)/ism", '$1<a class="zrl" href="$2$3" >$2$3</a>', $Text);
$Text = preg_replace_callback("/\[share(.*?)\](.*?)\[\/share\]/ism","bb_ShareAttributes",$Text);
diff --git a/include/items.php b/include/items.php
index 954042b65..088aa11a1 100755
--- a/include/items.php
+++ b/include/items.php
@@ -54,6 +54,31 @@ function collect_recipients($item,&$private) {
}
/**
+ * @function red_zrl_callback
+ * preg_match function when fixing 'naked' links in mod item.php
+ * Check if we've got a hubloc for the site and use a zrl if we do, a url if we don't.
+ *
+ */
+
+
+function red_zrl_callback($matches) {
+ $m = @parse_url($matches[2]);
+ $zrl = false;
+ if($m['host']) {
+ $r = q("select hubloc_url from hubloc where hubloc_host = '%s' limit 1",
+ dbesc($m['host'])
+ );
+ if($r)
+ $zrl = true;
+ }
+ if($zrl)
+ return $matches[1] . '[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]';
+ return $matches[0];
+}
+
+
+
+/**
* @function post_activity_item($arr)
*
* post an activity