- $replaced = false;
-
- //is it a person tag?
- if (Tag::isType($tag, Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION)) {
- $tag_type = substr($tag, 0, 1);
- //is it already replaced?
- if (strpos($tag, '[url=')) {
- // Checking for the alias that is used for OStatus
- $pattern = "/[@!]\[url\=(.*?)\](.*?)\[\/url\]/ism";
- if (preg_match($pattern, $tag, $matches)) {
- $data = Contact::getDetailsByURL($matches[1]);
-
- if ($data["alias"] != "") {
- $newtag = '@[url=' . $data["alias"] . ']' . $data["nick"] . '[/url]';
- }
- }
-
- return $replaced;
- }
-
- //get the person's name
- $name = substr($tag, 1);
+ // locate item to be deleted
+ $fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity', 'parent'];
+ $item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);