Ckeck for host differences of fetched objects

This commit is contained in:
Michael 2024-02-10 04:58:11 +00:00
parent ede41166ae
commit 50c0fd6738
2 changed files with 97 additions and 0 deletions

View file

@ -26,6 +26,7 @@ use Friendica\Core\Logger;
use Exception;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Protocol\ActivityPub;
/**
* This class contain methods to work with JsonLD data
@ -179,6 +180,10 @@ class JsonLD
$orig_json = $json;
if (empty($json['@context'])) {
$json['@context'] = ActivityPub::CONTEXT;
}
// Preparation for adding possibly missing content to the context
if (!empty($json['@context']) && is_string($json['@context'])) {
$json['@context'] = [$json['@context']];