modified file w3-total-cache
This commit is contained in:
@ -20,13 +20,13 @@ class Activity extends Base_Object {
|
||||
const CONTEXT = array(
|
||||
'https://www.w3.org/ns/activitystreams',
|
||||
'https://w3id.org/security/v1',
|
||||
'https://purl.archive.org/socialweb/webfinger',
|
||||
array(
|
||||
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
|
||||
'PropertyValue' => 'schema:PropertyValue',
|
||||
'schema' => 'http://schema.org#',
|
||||
'pt' => 'https://joinpeertube.org/ns#',
|
||||
'toot' => 'http://joinmastodon.org/ns#',
|
||||
'webfinger' => 'https://webfinger.net/#',
|
||||
'litepub' => 'http://litepub.social/ns#',
|
||||
'lemmy' => 'https://join-lemmy.org/ns#',
|
||||
'value' => 'schema:value',
|
||||
@ -51,7 +51,6 @@ class Activity extends Base_Object {
|
||||
'discoverable' => 'toot:discoverable',
|
||||
'indexable' => 'toot:indexable',
|
||||
'sensitive' => 'as:sensitive',
|
||||
'resource' => 'webfinger:resource',
|
||||
),
|
||||
);
|
||||
|
||||
@ -196,7 +195,7 @@ class Activity extends Base_Object {
|
||||
public function set_object( $object ) {
|
||||
// convert array to object
|
||||
if ( is_array( $object ) ) {
|
||||
$object = Base_Object::init_from_array( $object );
|
||||
$object = self::init_from_array( $object );
|
||||
}
|
||||
|
||||
// set object
|
||||
|
@ -254,19 +254,6 @@ class Base_Object {
|
||||
*/
|
||||
protected $published;
|
||||
|
||||
/**
|
||||
* A Collection containing objects considered to be responses to
|
||||
* this object.
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-replies
|
||||
*
|
||||
* @var string
|
||||
* | Collection
|
||||
* | Link
|
||||
* | null
|
||||
*/
|
||||
protected $replies;
|
||||
|
||||
/**
|
||||
* The date and time describing the actual or expected starting time
|
||||
* of the object.
|
||||
@ -437,6 +424,19 @@ class Base_Object {
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
/**
|
||||
* A Collection containing objects considered to be responses to
|
||||
* this object.
|
||||
*
|
||||
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-replies
|
||||
*
|
||||
* @var string
|
||||
* | Collection
|
||||
* | Link
|
||||
* | null
|
||||
*/
|
||||
protected $replies;
|
||||
|
||||
/**
|
||||
* Magic function to implement getter and setter
|
||||
*
|
||||
@ -671,8 +671,25 @@ class Base_Object {
|
||||
* @return string The JSON string.
|
||||
*/
|
||||
public function to_json() {
|
||||
$array = $this->to_array();
|
||||
$array = $this->to_array();
|
||||
$options = \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT;
|
||||
|
||||
return \wp_json_encode( $array, \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT );
|
||||
/*
|
||||
* Options to be passed to json_encode()
|
||||
*
|
||||
* @param int $options The current options flags
|
||||
*/
|
||||
$options = \apply_filters( 'activitypub_json_encode_options', $options );
|
||||
|
||||
return \wp_json_encode( $array, $options );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the keys of the object vars.
|
||||
*
|
||||
* @return array The keys of the object vars.
|
||||
*/
|
||||
public function get_object_var_keys() {
|
||||
return \array_keys( \get_object_vars( $this ) );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user