From db038c56542f7fb9658c3b7a703e50efe7823014 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 18 Apr 2013 17:55:35 -0700 Subject: turn naked links in posts into zrl's if we've got a hubloc for the site --- mod/item.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mod/item.php') diff --git a/mod/item.php b/mod/item.php index a9b658441..814c2f0c6 100644 --- a/mod/item.php +++ b/mod/item.php @@ -320,6 +320,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 -- cgit v1.2.3