use frozen jsonld contexts
This commit is contained in:
parent
b0cdec0c35
commit
00fe4e747f
@ -58,7 +58,7 @@ class ActivityStreams {
|
|||||||
$this->saved_recips = $arr;
|
$this->saved_recips = $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function collect_recips($base = '',$namespace = 'https://www.w3.org/ns/activitystreams') {
|
function collect_recips($base = '',$namespace = ACTIVITYSTREAMS_JSONLD_REV) {
|
||||||
$x = [];
|
$x = [];
|
||||||
$fields = [ 'to','cc','bto','bcc','audience'];
|
$fields = [ 'to','cc','bto','bcc','audience'];
|
||||||
foreach($fields as $f) {
|
foreach($fields as $f) {
|
||||||
@ -75,7 +75,7 @@ class ActivityStreams {
|
|||||||
return $x;
|
return $x;
|
||||||
}
|
}
|
||||||
|
|
||||||
function expand($arr,$base = '',$namespace = 'https://www.w3.org/ns/activitystreams') {
|
function expand($arr,$base = '',$namespace = ACTIVITYSTREAMS_JSONLD_REV) {
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
// right now use a hardwired recursion depth of 5
|
// 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);
|
$prefix = $this->get_namespace($base,$namespace);
|
||||||
if($prefix === null)
|
if($prefix === null)
|
||||||
return null;
|
return null;
|
||||||
@ -158,7 +158,7 @@ class ActivityStreams {
|
|||||||
return null;
|
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);
|
$x = $this->get_property_obj($property,$base,$namespace);
|
||||||
if($this->is_url($x)) {
|
if($this->is_url($x)) {
|
||||||
$x = $this->fetch_property($x);
|
$x = $this->fetch_property($x);
|
||||||
@ -173,7 +173,7 @@ class ActivityStreams {
|
|||||||
return false;
|
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)
|
if(! $base)
|
||||||
$base = $this->data;
|
$base = $this->data;
|
||||||
$x = $this->get_property_obj('type',$base,$namespace);
|
$x = $this->get_property_obj('type',$base,$namespace);
|
||||||
|
@ -35,7 +35,9 @@ class LDSignatures {
|
|||||||
$options['signatureValue'] = base64_encode(rsa_sign($ohash . $dhash,$channel['channel_prvkey']));
|
$options['signatureValue'] = base64_encode(rsa_sign($ohash . $dhash,$channel['channel_prvkey']));
|
||||||
|
|
||||||
$signed = array_merge([
|
$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);
|
],$options);
|
||||||
|
|
||||||
return $signed;
|
return $signed;
|
||||||
|
2
boot.php
2
boot.php
@ -456,6 +456,8 @@ define ( 'NAMESPACE_STATUSNET', 'http://status.net/schema/api/1/' );
|
|||||||
define ( 'NAMESPACE_ATOM1', 'http://www.w3.org/2005/Atom' );
|
define ( 'NAMESPACE_ATOM1', 'http://www.w3.org/2005/Atom' );
|
||||||
define ( 'NAMESPACE_YMEDIA', 'http://search.yahoo.com/mrss/' );
|
define ( 'NAMESPACE_YMEDIA', 'http://search.yahoo.com/mrss/' );
|
||||||
|
|
||||||
|
define ( 'ACTIVITYSTREAMS_JSONLD_REV', 'https://www.w3.org/ns/activitystreams-history/v1.8.jsonld' );
|
||||||
|
define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.2' );
|
||||||
/**
|
/**
|
||||||
* activity stream defines
|
* activity stream defines
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user