aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/ActivityStreams.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-09 09:50:08 +0000
committerMario <mario@mariovavti.com>2022-02-09 09:50:08 +0000
commit3d318542cb182673b5eeb635916da29267b843c9 (patch)
tree88e24a6176589c4d56598e25fe07bac653fd6ffc /Zotlabs/Lib/ActivityStreams.php
parent5bdc713afed394db3193a3b55cd8446cf614fb26 (diff)
parent4a8c3cdc6109c5515824082f57bdb801b13ef9e0 (diff)
downloadvolse-hubzilla-3d318542cb182673b5eeb635916da29267b843c9.tar.gz
volse-hubzilla-3d318542cb182673b5eeb635916da29267b843c9.tar.bz2
volse-hubzilla-3d318542cb182673b5eeb635916da29267b843c9.zip
Merge branch 'dev'
Diffstat (limited to 'Zotlabs/Lib/ActivityStreams.php')
-rw-r--r--Zotlabs/Lib/ActivityStreams.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index 323b0e273..275f6eff4 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -11,6 +11,7 @@ class ActivityStreams {
public $raw = null;
public $data = null;
+ public $meta = null;
public $valid = false;
public $deleted = false;
public $id = '';
@@ -36,6 +37,9 @@ class ActivityStreams {
*/
function __construct($string) {
+ if(!$string)
+ return;
+
$this->raw = $string;
if (is_array($string)) {
@@ -57,10 +61,10 @@ class ActivityStreams {
if ($ret['signer']) {
$saved = json_encode($this->data, JSON_UNESCAPED_SLASHES);
$this->data = $tmp;
- $this->data['signer'] = $ret['signer'];
- $this->data['signed_data'] = $saved;
+ $this->meta['signer'] = $ret['signer'];
+ $this->meta['signed_data'] = $saved;
if ($ret['hubloc']) {
- $this->data['hubloc'] = $ret['hubloc'];
+ $this->meta['hubloc'] = $ret['hubloc'];
}
}
}
@@ -88,7 +92,7 @@ class ActivityStreams {
$this->ldsig = $this->get_compound_property('signature');
if ($this->ldsig) {
- $this->signer = $this->get_compound_property('creator', $this->ldsig);
+ $this->signer = $this->get_actor('creator', $this->ldsig);
if ($this->signer && is_array($this->signer) && array_key_exists('publicKey', $this->signer) && is_array($this->signer['publicKey']) && $this->signer['publicKey']['publicKeyPem']) {
$this->sigok = LDSignatures::verify($this->data, $this->signer['publicKey']['publicKeyPem']);
}
@@ -344,10 +348,10 @@ class ActivityStreams {
if ($ret['signer']) {
$saved = json_encode($x, JSON_UNESCAPED_SLASHES);
$x = $tmp;
- $x['signer'] = $ret['signer'];
- $x['signed_data'] = $saved;
+ $x['meta']['signer'] = $ret['signer'];
+ $x['meta']['signed_data'] = $saved;
if ($ret['hubloc']) {
- $x['hubloc'] = $ret['hubloc'];
+ $x['meta']['hubloc'] = $ret['hubloc'];
}
}
}