From 884034d1206b40acab9b99ea08b9c3f771d05431 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 16 Feb 2012 07:57:41 +0100 Subject: [PATCH] sn commented out some regex for various reasons --- statusnet/statusnet.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 1975277a..1bbe6427 100755 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -1,6 +1,7 @@ */ @@ -393,15 +394,18 @@ function statusnet_post_hook(&$a,&$b) { $dent = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret); $max_char = $dent->get_maxlength(); // max. length for a dent // if [url=bla][img]blub.png[/img][/url] get blub.png - $tmp = preg_replace( '/\[url\=(\w+.*?)\]\[img\](\w+.*?)\[\/img\]\[\/url\]/i', '$2', $tmp); +// $tmp = preg_replace( '/\[url\=(\w+.*?)\]\[img\](\w+.*?)\[\/img\]\[\/url\]/i', '$2', $b['body']); // preserve links to images, videos and audios - $tmp = preg_replace( '/\[\\/?img(\\s+.*?\]|\])/i', '', $b['body']); + $tmp = preg_replace( '/\[\\/?img(\\s+.*?\]|\])/i', '', $tmp); $tmp = preg_replace( '/\[\\/?video(\\s+.*?\]|\])/i', '', $tmp); $tmp = preg_replace( '/\[\\/?youtube(\\s+.*?\]|\])/i', '', $tmp); $tmp = preg_replace( '/\[\\/?vimeo(\\s+.*?\]|\])/i', '', $tmp); $tmp = preg_replace( '/\[\\/?audio(\\s+.*?\]|\])/i', '', $tmp); // if a #tag is linked, don't send the [url] over to SN - $tmp = preg_replace( '/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $tmp); + // this is commented out by default as it means backlinks + // to friendica, if you don't like this feel free to + // uncomment the following line +// $tmp = preg_replace( '/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '#$2', $tmp); // preserve links to webpages $tmp = preg_replace( '/\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', '$2 $1', $tmp); // TODO apply the shortener to the URLs in the releyed dent -- 2.39.5