- function api_cleanup_share($shared) {
- if ($shared[2] != "type-link")
- return($shared[0]);
-
- if (!preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism",$shared[3], $bookmark))
- return($shared[0]);
-
- $title = "";
- $link = "";
-
- if (isset($bookmark[2][0]))
- $title = $bookmark[2][0];
-
- if (isset($bookmark[1][0]))
- $link = $bookmark[1][0];
+ /**
+ * @brief Removes most sharing information for API text export
+ *
+ * @param string $body The original body
+ *
+ * @return string Cleaned body
+ */
+ function api_clean_attachments($body) {
+ $data = get_attachment_data($body);