X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub.php;h=beb5be125d3df9bf98e332e19216b8f4fb2fae1b;hb=8f27e3aeb11809db601bea1d3690343377c940ca;hp=107cc423a6b88f9344576f0dcb5e1f09fbe35248;hpb=1395bdc1881e8e8ecac3823f62648d250fcf7874;p=friendica.git diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index 107cc423a6..beb5be125d 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -7,6 +7,7 @@ namespace Friendica\Protocol; use Friendica\Util\Network; use Friendica\Core\Protocol; use Friendica\Model\APContact; +use Friendica\Util\HTTPSignature; /** * @brief ActivityPub Protocol class @@ -59,11 +60,16 @@ class ActivityPub /** * Fetches ActivityPub content from the given url * - * @param string $url content url + * @param string $url content url + * @param integer $uid User ID for the signature * @return array */ - public static function fetchContent($url) + public static function fetchContent($url, $uid = 0) { + if (!empty($uid)) { + return HTTPSignature::fetch($url, 1); + } + $curlResult = Network::curl($url, false, $redirects, ['accept_content' => 'application/activity+json, application/ld+json']); if (!$curlResult->isSuccess() || empty($curlResult->getBody())) { return false;