Skip to content

Commit

Permalink
Fix 9th miscellaneous bug (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
BentiGorlich authored Sep 12, 2024
1 parent 30cbcfd commit b12adeb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Service/ActivityPubManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,14 @@ public function buildHandle(string $id): string
$port = !\is_null(parse_url($id, PHP_URL_PORT))
? ':'.parse_url($id, PHP_URL_PORT)
: '';
$apObj = $this->apHttpClient->getActorObject($id);
if (!isset($apObj['preferredUsername'])) {
throw new \InvalidArgumentException("webfinger from $id does not supply a valid user object");
}

return \sprintf(
'%s@%s%s',
$this->apHttpClient->getActorObject($id)['preferredUsername'],
$apObj['preferredUsername'],
parse_url($id, PHP_URL_HOST),
$port
);
Expand Down

0 comments on commit b12adeb

Please sign in to comment.