]> git.mxchange.org Git - friendica-addons.git/blobdiff - fbpost/fbpost.php
Setting "editplain", "page" and "privacy_image_cache" as deprecated. Using new cache...
[friendica-addons.git] / fbpost / fbpost.php
index 579fb148c1f25b718d84ac462f4ec3c7e3122a16..2ac558ea8def501329e32c1b58dafceffebadb4f 100644 (file)
@@ -1032,6 +1032,13 @@ function fbpost_fetchwall($a, $uid) {
                        $oembed_data = oembed_fetch_url($item->link);
                        $type = $oembed_data->type;
                        $content = "[bookmark=".$item->link."]".$item->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($item->link, "", $_REQUEST["body"]));
+
+                       if (($removedlink == "") OR strstr($_REQUEST["body"], $removedlink))
+                               $_REQUEST["body"] = $removedlink;
+
                } elseif (isset($item->name))
                        $content .= "[b]".$item->name."[/b]";