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