From 00fe4e747f9884ab11fe94621f645fc351285964 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 19 Sep 2017 21:40:38 -0700 Subject: use frozen jsonld contexts --- Zotlabs/Lib/ActivityStreams.php | 10 +++++----- Zotlabs/Lib/LDSignatures.php | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index d9735881a..1b9f82ddf 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -58,7 +58,7 @@ class ActivityStreams { $this->saved_recips = $arr; } - function collect_recips($base = '',$namespace = 'https://www.w3.org/ns/activitystreams') { + function collect_recips($base = '',$namespace = ACTIVITYSTREAMS_JSONLD_REV) { $x = []; $fields = [ 'to','cc','bto','bcc','audience']; foreach($fields as $f) { @@ -75,7 +75,7 @@ class ActivityStreams { return $x; } - function expand($arr,$base = '',$namespace = 'https://www.w3.org/ns/activitystreams') { + function expand($arr,$base = '',$namespace = ACTIVITYSTREAMS_JSONLD_REV) { $ret = []; // right now use a hardwired recursion depth of 5 @@ -135,7 +135,7 @@ class ActivityStreams { } - function get_property_obj($property,$base = '',$namespace = 'https://www.w3.org/ns/activitystreams') { + function get_property_obj($property,$base = '',$namespace = ACTIVITYSTREAMS_JSONLD_REV ) { $prefix = $this->get_namespace($base,$namespace); if($prefix === null) return null; @@ -158,7 +158,7 @@ class ActivityStreams { return null; } - function get_compound_property($property,$base = '',$namespace = 'https://www.w3.org/ns/activitystreams') { + function get_compound_property($property,$base = '',$namespace = ACTIVITYSTREAMS_JSONLD_REV) { $x = $this->get_property_obj($property,$base,$namespace); if($this->is_url($x)) { $x = $this->fetch_property($x); @@ -173,7 +173,7 @@ class ActivityStreams { return false; } - function get_primary_type($base = '',$namespace = 'https://www.w3.org/ns/activitystreams') { + function get_primary_type($base = '',$namespace = ACTIVITYSTREAMS_JSONLD_REV) { if(! $base) $base = $this->data; $x = $this->get_property_obj('type',$base,$namespace); diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php index 77e2ef332..31ffd71f1 100644 --- a/Zotlabs/Lib/LDSignatures.php +++ b/Zotlabs/Lib/LDSignatures.php @@ -35,7 +35,9 @@ class LDSignatures { $options['signatureValue'] = base64_encode(rsa_sign($ohash . $dhash,$channel['channel_prvkey'])); $signed = array_merge([ - '@context' => [ 'https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1' ], + '@context' => [ + ACTIVITYSTREAMS_JSONLD_REV, + 'https://w3id.org/security/v1' ], ],$options); return $signed; -- cgit v1.2.3