aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-05-25 08:34:29 +0000
committerMario <mario@mariovavti.com>2022-05-25 08:34:29 +0000
commit50782dfb830c55f4b84e0650c2ea0a5a973ea94d (patch)
tree1694afc31cd5437d50d49abd61326e190f507e65
parent27a142d5c5c2d2926399a9834f6203c6a6102ca7 (diff)
downloadvolse-hubzilla-50782dfb830c55f4b84e0650c2ea0a5a973ea94d.tar.gz
volse-hubzilla-50782dfb830c55f4b84e0650c2ea0a5a973ea94d.tar.bz2
volse-hubzilla-50782dfb830c55f4b84e0650c2ea0a5a973ea94d.zip
prevent php error and add some doco
-rw-r--r--Zotlabs/Lib/ActivityStreams.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index 1c278f2ee..e77b501b3 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -70,9 +70,12 @@ class ActivityStreams {
}
}
+ // This indicates only that we have sucessfully decoded JSON.
$this->valid = true;
- if (array_key_exists('type', $this->data) && array_key_exists('actor', $this->data) && array_key_exists('object', $this->data)) {
+ // Special handling for Mastodon "delete actor" activities which will often fail to verify
+ // because the key cannot be fetched. We will catch this condition elsewhere.
+ if (is_array($this->data) && array_key_exists('type', $this->data) && array_key_exists('actor', $this->data) && array_key_exists('object', $this->data)) {
if ($this->data['type'] === 'Delete' && $this->data['actor'] === $this->data['object']) {
$this->deleted = $this->data['actor'];
$this->valid = false;
@@ -81,6 +84,7 @@ class ActivityStreams {
}
+ // Attempt to assemble an Activity from what we were given.
if ($this->is_valid()) {
$this->id = $this->get_property_obj('id');
$this->type = $this->get_primary_type();