aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-04-18 17:55:35 -0700
committerfriendica <info@friendica.com>2013-04-18 17:55:35 -0700
commitdb038c56542f7fb9658c3b7a703e50efe7823014 (patch)
treeb0f0af805f46209406ccfed3969718f5d414ed35 /mod/item.php
parentba1cb0bb059bfcd20ec2a14b70c4a79b4a222977 (diff)
downloadvolse-hubzilla-db038c56542f7fb9658c3b7a703e50efe7823014.tar.gz
volse-hubzilla-db038c56542f7fb9658c3b7a703e50efe7823014.tar.bz2
volse-hubzilla-db038c56542f7fb9658c3b7a703e50efe7823014.zip
turn naked links in posts into zrl's if we've got a hubloc for the site
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index a9b658441..814c2f0c6 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -321,6 +321,13 @@ function item_post(&$a) {
/**
+ * fix naked links by passing through a callback to see if this is a red site
+ * (already known to us) which will get a zrl, otherwise link with url
+ */
+
+ $body = preg_replace_callback("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)/ism", 'red_zrl_callback', $body);
+
+ /**
*
* When a photo was uploaded into the message using the (profile wall) ajax
* uploader, The permissions are initially set to disallow anybody but the