diff --git a/plugins/ActivityPub/classes/Activitypub_profile.php b/plugins/ActivityPub/classes/Activitypub_profile.php index d576d13e69..ee1aedeac8 100644 --- a/plugins/ActivityPub/classes/Activitypub_profile.php +++ b/plugins/ActivityPub/classes/Activitypub_profile.php @@ -489,7 +489,7 @@ class Activitypub_profile extends Managed_DataObject * @throws NoProfileException * @author Diogo Cordeiro */ - public static function update_profile(Activitypub_profile $aprofile, array $res): Profile + public static function update_profile(Activitypub_profile $aprofile, $res): Profile { if ($res === false) { $profile = $aprofile->local_profile(); @@ -498,6 +498,10 @@ class Activitypub_profile extends Managed_DataObject throw new NoProfileException($id, "410 Gone"); } + if (!is_array($res)) { + throw new InvalidArgumentException('TypeError: Argument 2 passed to Activitypub_profile::update_profile() must be of the type array or bool(false).'); + } + // ActivityPub Profile $aprofile->uri = $res['id']; $aprofile->nickname = $res['preferredUsername'];