mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:55:18 +00:00
php errors
This commit is contained in:
parent
91cf3e4349
commit
c5acf1d41b
3 changed files with 12 additions and 18 deletions
|
@ -3014,7 +3014,7 @@ class Activity
|
|||
in_array($act->type, ['Follow', 'Accept', 'Reject', 'Create', 'Update'])
|
||||
&& ($act->objprop('type') === 'Follow' || ActivityStreams::is_an_actor($act->objprop('type')))
|
||||
) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
// Within our family of projects, Follow/Unfollow of a thread is an internal activity which should not be transmitted,
|
||||
|
@ -3022,14 +3022,14 @@ class Activity
|
|||
// This may have to be revisited if AP projects start using Follow for objects other than actors.
|
||||
|
||||
if (in_array($act->type, [ACTIVITY_FOLLOW, ACTIVITY_IGNORE])) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
// Do not proceed further if there is no actor.
|
||||
|
||||
if (!isset($act->actor['id'])) {
|
||||
logger('No actor!');
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
$item['owner_xchan'] = $act->actor['id'];
|
||||
|
@ -3043,7 +3043,7 @@ class Activity
|
|||
// Do not continue without a message-id.
|
||||
|
||||
if (!$item['mid']) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
// Translate event urls to internal items.
|
||||
|
@ -3088,7 +3088,7 @@ class Activity
|
|||
// scrobblers and seem to only put noise into your stream and then vanish abruptly.
|
||||
if ($item['expires'] > NULL_DATE && $item['expires'] < Time::convert(datetime: 'now + 15 minutes')) {
|
||||
// We shouldn't even be seeing this activity.
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
|
@ -3139,7 +3139,7 @@ class Activity
|
|||
// Seen in the wild with a post from jasonrobinson.me being liked by a Friendica account.
|
||||
|
||||
if (! is_string($item['parent_mid'])) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
$item['parent_mid'] = reverse_activity_mid($item['parent_mid']);
|
||||
|
@ -3171,7 +3171,7 @@ class Activity
|
|||
$obj_actor = Activity::fetch($obj_actor);
|
||||
}
|
||||
if (! is_array($obj_actor)) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
|
||||
// We already check for admin blocks of third-party objects when fetching them explicitly.
|
||||
|
@ -3181,11 +3181,11 @@ class Activity
|
|||
$parsed = parse_url($obj_actor['id']);
|
||||
if ($parsed && $parsed['scheme'] && $parsed['host']) {
|
||||
if (!check_siteallowed($parsed['scheme'] . '://' . $parsed['host'])) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
}
|
||||
if (!check_channelallowed($obj_actor['id'])) {
|
||||
return false;
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2234,6 +2234,9 @@ class Libzot
|
|||
continue;
|
||||
}
|
||||
$arr = Activity::decode_note($AS);
|
||||
if (!$arr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$r = hubloc_id_query($AS->actor['id'], 1);
|
||||
|
||||
|
|
|
@ -41,15 +41,6 @@ function photo_factory($data, $type = null)
|
|||
|
||||
if (class_exists('Imagick') && !$ignore_imagick) {
|
||||
$ph = new PhotoImagick($data, $type);
|
||||
|
||||
// As of August 2020, webp support is still poor in both imagick and gd. Both claim to support it,
|
||||
// but both may require additional configuration. If it's a webp and the imagick driver failed,
|
||||
// we'll try again with GD just in case that one handles it. If not, you may need to install libwebp
|
||||
// which should make imagick work and/or re-compile php-gd with the option to include that library.
|
||||
|
||||
if (! $ph->is_valid() && $type === 'image/webp') {
|
||||
$ph = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $ph) {
|
||||
|
|
Loading…
Reference in a new issue