mirror of
https://github.com/friendica/friendica
synced 2025-04-24 07:10:11 +00:00
Only use and accept valid http links as links to an external resource
This commit is contained in:
parent
e9a6c4a7e3
commit
029daef997
3 changed files with 27 additions and 5 deletions
|
@ -37,6 +37,7 @@ use Friendica\Protocol\ActivityPub;
|
|||
use Friendica\Util\HTTPSignature;
|
||||
use Friendica\Util\JsonLD;
|
||||
use Friendica\Util\LDSignature;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
|
@ -1533,6 +1534,10 @@ class Receiver
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($object_data['alternate-url']) && !Network::isValidHttpUrl($object_data['alternate-url'])) {
|
||||
$object_data['alternate-url'] = null;
|
||||
}
|
||||
|
||||
if (in_array($object_data['object_type'], ['as:Audio', 'as:Video'])) {
|
||||
$object_data['alternate-url'] = self::extractAlternateUrl($object['as:url'] ?? []) ?: $object_data['alternate-url'];
|
||||
$object_data['attachments'] = array_merge($object_data['attachments'], self::processAttachmentUrls($object['as:url'] ?? []));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue