aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2022-02-08 15:15:34 +0100
committerMario Vavti <mario@mariovavti.com>2022-02-08 15:15:34 +0100
commit63243c8e0417f6922e745aca3593bb06cb46760e (patch)
treea883b2e00380cdcadc54ce7dc4515c631d56bb81 /Zotlabs/Lib
parent21c4ec2de0f26341c3dcfda2c03f2db6be2795bf (diff)
parenta8d87af41844c8598a9ef58a8f900831d1f7ea03 (diff)
downloadvolse-hubzilla-63243c8e0417f6922e745aca3593bb06cb46760e.tar.gz
volse-hubzilla-63243c8e0417f6922e745aca3593bb06cb46760e.tar.bz2
volse-hubzilla-63243c8e0417f6922e745aca3593bb06cb46760e.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php12
-rw-r--r--Zotlabs/Lib/ActivityStreams.php2
2 files changed, 11 insertions, 3 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 159f2a46f..e51922c86 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -116,6 +116,11 @@ class Activity {
$y = json_decode($x['body'], true);
logger('returned: ' . json_encode($y, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), LOGGER_DEBUG);
+
+ if (ActivityStreams::is_an_actor($y['type'])) {
+ XConfig::Set($y['id'], 'system', 'actor_record', $y);
+ }
+
return json_decode($x['body'], true);
}
else {
@@ -3709,7 +3714,10 @@ class Activity {
}
static function get_cached_actor($id) {
- $actor = XConfig::Get($id, 'system', 'actor_record');
+
+ // remove any fragments like #main-key since these won't be present in our cached data
+ $cache_url = ((strpos($id, '#')) ? substr($id, 0, strpos($id, '#')) : $id);
+ $actor = XConfig::Get($cache_url, 'system', 'actor_record');
if ($actor) {
return $actor;
@@ -3718,7 +3726,7 @@ class Activity {
// try other get_cached_actor providers (e.g. diaspora)
$hookdata = [
'id' => $id,
- 'actor' => false
+ 'actor' => null
];
call_hooks('get_cached_actor_provider', $hookdata);
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index b86203a34..275f6eff4 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -92,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']);
}