]> 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 c5b7918315f2508b1d7a80c9272df623217a87a1..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]";
 
@@ -1055,7 +1062,7 @@ function fbpost_fetchwall($a, $uid) {
 
                        if (($type == "photo") AND isset($item->object_id)) {
                                 logger('fbpost_fetchwall: fetching fbid '.$item->object_id, LOGGER_DEBUG);
-                               $url = "https://graph.facebook.com/v2.0/".$item->object_id."/?access_token=".$access_token;
+                               $url = "https://graph.facebook.com/".$item->object_id."?access_token=".$access_token;
                                $feed = fetch_url($url);
                                $data = json_decode($feed);
                                if (isset($data->images)) {