-/**
- * @brief Removes most sharing information for API text export
- *
- * @param string $body The original body
- *
- * @return string Cleaned body
- * @throws InternalServerErrorException
- */
-function api_clean_attachments($body)
-{
- $data = BBCode::getAttachmentData($body);
-
- if (empty($data)) {
- return $body;
- }
- $body = "";
-
- if (isset($data["text"])) {
- $body = $data["text"];
- }
- if (($body == "") && isset($data["title"])) {
- $body = $data["title"];
- }
- if (isset($data["url"])) {
- $body .= "\n".$data["url"];
- }
- $body .= $data["after"];
-
- return $body;
-}
-