- if (!$feed_mode) {
- // Make sure that mentions are accepted (GNU Social has problems with mixing HTTP and HTTPS)
- $newmentions = [];
- foreach ($mentioned as $mention) {
- $newmentions[str_replace("http://", "https://", $mention)] = str_replace("http://", "https://", $mention);
- $newmentions[str_replace("https://", "http://", $mention)] = str_replace("https://", "http://", $mention);
- }
- $mentioned = $newmentions;
-
- foreach ($mentioned as $mention) {
- $contact = Contact::getByURL($mention, ['contact-type']);
- if (!empty($contact) && ($contact['contact-type'] == Contact::TYPE_COMMUNITY)) {
- XML::addElement($doc, $entry, "link", "",
- [
- "rel" => "mentioned",
- "ostatus:object-type" => Activity\ObjectType::GROUP,
- "href" => $mention]
- );
- } else {
- XML::addElement($doc, $entry, "link", "",
- [
- "rel" => "mentioned",
- "ostatus:object-type" => Activity\ObjectType::PERSON,
- "href" => $mention]
- );
- }
- }
+ // Make sure that mentions are accepted (GNU Social has problems with mixing HTTP and HTTPS)
+ $newmentions = [];
+ foreach ($mentioned as $mention) {
+ $newmentions[str_replace("http://", "https://", $mention)] = str_replace("http://", "https://", $mention);
+ $newmentions[str_replace("https://", "http://", $mention)] = str_replace("https://", "http://", $mention);
+ }
+ $mentioned = $newmentions;