X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=fbsync%2Ffbsync.php;h=51d2747f93d8640570032d8eda81f575c796b412;hb=23490bda0a5ec9889afca89189db9c59f76fbcc5;hp=78ecea1dd6978c0d80e3f7f706bf84884e0f1da5;hpb=eb707da56282cafeca7e8c313e1d9d3b5a3b1c6b;p=friendica-addons.git diff --git a/fbsync/fbsync.php b/fbsync/fbsync.php index 78ecea1d..51d2747f 100644 --- a/fbsync/fbsync.php +++ b/fbsync/fbsync.php @@ -345,6 +345,13 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr $type = "link"; $content = "[bookmark=".$post->attachment->href."]".$post->attachment->name."[/bookmark]"; + + // If a link is not only attached but also added in the body, look if it can be removed in the body. + $removedlink = trim(str_replace($post->attachment->href, "", $postarray["body"])); + + if (($removedlink == "") OR strstr($postarray["body"], $removedlink)) + $postarray["body"] = $removedlink; + } elseif (isset($post->attachment->name) AND ($post->attachment->name != "")) $content = "[b]" . $post->attachment->name."[/b]";