$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]";
'to_email' => $user[0]['email'],
'uid' => $user[0]['uid'],
'item' => $postarray,
- //'link' => $a->get_baseurl() . '/display/' . $user[0]['nickname'] . '/' . $item,
- 'link' => $a->get_baseurl().'/display/'.get_item_guid($item),
+ 'link' => $a->get_baseurl().'/display/'.urlencode(get_item_guid($item)),
'source_name' => $postarray['author-name'],
'source_link' => $postarray['author-link'],
'source_photo' => $postarray['author-avatar'],