patches for getBestSupportedMimeType
This commit is contained in:
parent
9fddc0f606
commit
3c021db5f0
@ -905,8 +905,12 @@ class ActivityPubReturn
|
||||
*/
|
||||
public static function getBestSupportedMimeType($mimeTypes = null)
|
||||
{
|
||||
if (!isset($_SERVER['HTTP_ACCEPT'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Values will be stored in this array
|
||||
$AcceptTypes = array();
|
||||
$AcceptTypes = [];
|
||||
|
||||
// Accept header is case insensitive, and whitespace isn’t important
|
||||
$accept = strtolower(str_replace(' ', '', $_SERVER['HTTP_ACCEPT']));
|
||||
|
@ -46,9 +46,9 @@ try {
|
||||
try {
|
||||
if (!Subscription::exists($actor_profile, $object_profile)) {
|
||||
Subscription::start($actor_profile, $object_profile);
|
||||
common_debug('ActivityPubPlugin: Accepted Follow request from '.$data->actor.' to '.$data->object);
|
||||
$postman = new Activitypub_postman($actor_profile);
|
||||
$postman->send(json_encode(Activitypub_accept::accept_to_array(Activitypub_follow::follow_to_array($data->actor, $data->object))), $object_profile->getInbox());
|
||||
common_debug('ActivityPubPlugin: Accepted Follow request from '.$data->actor.' to '.$data->object);
|
||||
ActivityPubReturn::answer('', 202);
|
||||
} else {
|
||||
common_debug('ActivityPubPlugin: Received a repeated Follow request from '.$data->actor.' to '.$data->object);
|
||||
|
Reference in New Issue
Block a user