Update ActivityPubFetchService.php

pull/6552/head
Shlee 2 months ago committed by GitHub
parent dd995e3716
commit e73ce720b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -137,23 +137,22 @@ class ActivityPubFetchService
}
//// For application/ld+json, verify the ActivityStreams profile parameter
// TODO: Validate if this check is required
// if ($mediaType === 'application/ld+json') {
// $hasActivityStreamsProfile = false;
// foreach (array_slice($contentTypeParts, 1) as $param) {
// $param = trim($param);
// if (stripos($param, 'profile=') === 0) {
// $profile = trim(substr($param, strlen('profile=')), ' "\'');
// if ($profile === 'https://www.w3.org/ns/activitystreams') {
// $hasActivityStreamsProfile = true;
// break;
// }
// }
// }
// if (! $hasActivityStreamsProfile) {
// return;
// }
// }
if ($mediaType === 'application/ld+json') {
$hasActivityStreamsProfile = false;
foreach (array_slice($contentTypeParts, 1) as $param) {
$param = trim($param);
if (stripos($param, 'profile=') === 0) {
$profile = trim(substr($param, strlen('profile=')), ' "\'');
if ($profile === 'https://www.w3.org/ns/activitystreams') {
$hasActivityStreamsProfile = true;
break;
}
}
}
if (! $hasActivityStreamsProfile) {
return;
}
}
return $returnJsonFormat ? $res->json() : $res->body();
}

Loading…
Cancel
Save