File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -746,6 +746,23 @@ private function sanitizePropertyFediverse(IAccountProperty $property): void {
746746 if (!is_array ($ decoded ) || ($ decoded ['subject ' ] ?? '' ) !== "acct: {$ username }@ {$ instance }" ) {
747747 throw new InvalidArgumentException ();
748748 }
749+ // check for activitypub link
750+ if (is_array ($ decoded ['links ' ]) && isset ($ decoded ['links ' ])) {
751+ $ found = false ;
752+ foreach ($ decoded ['links ' ] as $ link ) {
753+ // have application/activity+json or application/ld+json
754+ if (isset ($ link ['type ' ]) && (
755+ $ link ['type ' ] === 'application/activity+json ' ||
756+ $ link ['type ' ] === 'application/ld+json; profile="https://www.w3.org/ns/activitystreams" '
757+ )) {
758+ $ found = true ;
759+ break ;
760+ }
761+ }
762+ if (!$ found ) {
763+ throw new InvalidArgumentException ();
764+ }
765+ }
749766 } catch (InvalidArgumentException ) {
750767 throw new InvalidArgumentException (self ::PROPERTY_FEDIVERSE );
751768 } catch (\Exception $ error ) {
You can’t perform that action at this time.
0 commit comments