Compare commits

...

4 commits

Author SHA1 Message Date
be8477771c Merge branch 'dev/extendable-transformers' of ssh://code.event-federation.eu:2222/Event-Federation/wordpress-activitypub into dev/extendable-transformers
Some checks failed
Unit Testing / phpunit (7.0) (push) Waiting to run
Unit Testing / phpunit (7.2) (push) Waiting to run
Unit Testing / phpunit (7.3) (push) Waiting to run
Unit Testing / phpunit (7.4) (push) Waiting to run
Unit Testing / phpunit (8.0) (push) Waiting to run
Unit Testing / phpunit (8.1) (push) Waiting to run
Unit Testing / phpunit (8.2) (push) Waiting to run
Unit Testing / phpunit (latest) (push) Waiting to run
PHP_CodeSniffer / phpcs (push) Failing after 5m14s
Unit Testing / phpunit (5.6, 6.2) (push) Has been cancelled
2023-12-12 17:00:37 +01:00
41412a9b34 temporary fixes in order to allow testing with mobilizon at this moment 2023-12-12 17:00:35 +01:00
665af185bf json: don't escape backslashes 2023-12-12 17:00:08 +01:00
5aaba2a907 fix typo 2023-12-08 14:09:52 +01:00
6 changed files with 7 additions and 8 deletions

View file

@ -34,7 +34,7 @@ require_once __DIR__ . '/includes/functions.php';
\defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) || \define( 'ACTIVITYPUB_AUTHORIZED_FETCH', false ); \defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) || \define( 'ACTIVITYPUB_AUTHORIZED_FETCH', false );
\defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || \define( 'ACTIVITYPUB_DISABLE_REWRITES', false ); \defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || \define( 'ACTIVITYPUB_DISABLE_REWRITES', false );
\defined( 'ACTIVITYPUB_DEFAULT_TRANSFORMER' ) || \define( 'ACTIVITYPUB_DEFAULT_TRANSFORMER', 'activitypub/default' ); \defined( 'ACTIVITYPUB_DEFAULT_TRANSFORMER' ) || \define( 'ACTIVITYPUB_DEFAULT_TRANSFORMER', 'activitypub/default' );
\defined( 'ACTIVITYPUB_JSON_FORMAT_OPTIONS' ) || \define( 'ACTIVITYPUB_JSON_FORMAT_OPTIONS', \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT | \JSON_UNESCAPED_SLASHES);
\define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); \define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
\define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); \define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

View file

@ -19,7 +19,7 @@ class Actor extends Base_Object {
/** /**
* @var string * @var string
*/ */
protected $type = 'Person'; protected $type = 'Group';
/** /**
* A reference to an ActivityStreams OrderedCollection comprised of * A reference to an ActivityStreams OrderedCollection comprised of

View file

@ -55,9 +55,9 @@ class Blog_User extends User {
*/ */
public function get_type() { public function get_type() {
if ( is_single_user() ) { if ( is_single_user() ) {
return 'Person'; return 'Application';
} else { } else {
return 'Group'; return 'Application';
} }
} }

View file

@ -41,7 +41,7 @@ class User extends Actor {
* *
* @var string * @var string
*/ */
protected $type = 'Person'; protected $type = 'Group';
/** /**
* If the User is discoverable. * If the User is discoverable.

View file

@ -116,7 +116,7 @@ class Post extends Base {
* @return \Activitypub\Activity\Base_Object The ActivityPub Object * @return \Activitypub\Activity\Base_Object The ActivityPub Object
*/ */
public function transform() { public function transform() {
$object = new Base_Objet(); $object = new Base_Object();
$wp_post = $this->get_wp_post(); $wp_post = $this->get_wp_post();
$object->set_id( $this->get_id() ); $object->set_id( $this->get_id() );

View file

@ -20,7 +20,7 @@ if ( \get_query_var( 'pretty' ) ) {
$options |= \JSON_PRETTY_PRINT; // phpcs:ignore $options |= \JSON_PRETTY_PRINT; // phpcs:ignore
} }
$options |= \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT; $options |= ACTIVITYPUB_JSON_FORMAT_OPTIONS;
/* /*
* Options to be passed to json_encode() * Options to be passed to json_encode()
@ -31,7 +31,6 @@ $options = \apply_filters( 'activitypub_json_post_options', $options );
\header( 'Content-Type: application/activity+json' ); \header( 'Content-Type: application/activity+json' );
echo \wp_json_encode( $json, $options ); echo \wp_json_encode( $json, $options );
/* /*
* Action triggerd after the ActivityPub profile has been created and sent to the client * Action triggerd after the ActivityPub profile has been created and sent to the client
*/ */