From 7b262fd613480eae669db4e30f0101bb8549df9b Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Wed, 17 Nov 2021 21:11:34 +0100 Subject: [PATCH] fix "Follow" issue fix #133 --- README.md | 6 +++++- activitypub.php | 2 +- includes/rest/class-inbox.php | 15 +++++++++------ readme.txt | 6 +++++- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fad4ec5..7c424d2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** OStatus, fediverse, activitypub, activitystream **Requires at least:** 4.7 **Tested up to:** 5.8 -**Stable tag:** 0.13.1 +**Stable tag:** 0.13.2 **Requires PHP:** 5.6 **License:** MIT **License URI:** http://opensource.org/licenses/MIT @@ -88,6 +88,10 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). +### 0.13.2 ### + +* fix Follow issue AGAIN + ### 0.13.1 ### * fix Inbox issue diff --git a/activitypub.php b/activitypub.php index 41188af..c54be22 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 0.13.1 + * Version: 0.13.2 * Author: Matthias Pfefferle * Author URI: https://notiz.blog/ * License: MIT diff --git a/includes/rest/class-inbox.php b/includes/rest/class-inbox.php index 4dcbd8c..1179070 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -139,6 +139,7 @@ class Inbox { $data = $request->get_params(); $type = $request->get_param( 'type' ); + $type = \strtolower( $type ); \do_action( 'activitypub_inbox', $data, $user_id, $type ); \do_action( "activitypub_inbox_{$type}", $data, $user_id ); @@ -173,6 +174,8 @@ class Inbox { } foreach ( $users as $user ) { + $type = \strtolower( $type ); + \do_action( 'activitypub_inbox', $data, $user->ID, $type ); \do_action( "activitypub_inbox_{$type}", $data, $user->ID ); } @@ -216,9 +219,9 @@ class Inbox { 'required' => true, //'type' => 'enum', //'enum' => array( 'Create' ), - 'sanitize_callback' => function( $param, $request, $key ) { - return \strtolower( $param ); - }, + //'sanitize_callback' => function( $param, $request, $key ) { + // return \strtolower( $param ); + //}, ); $params['object'] = array( @@ -261,9 +264,9 @@ class Inbox { 'required' => true, //'type' => 'enum', //'enum' => array( 'Create' ), - 'sanitize_callback' => function( $param, $request, $key ) { - return \strtolower( $param ); - }, + //'sanitize_callback' => function( $param, $request, $key ) { + // return \strtolower( $param ); + //}, ); $params['object'] = array( diff --git a/readme.txt b/readme.txt index e6dc463..1655032 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://notiz.blog/donate/ Tags: OStatus, fediverse, activitypub, activitystream Requires at least: 4.7 Tested up to: 5.8 -Stable tag: 0.13.1 +Stable tag: 0.13.2 Requires PHP: 5.6 License: MIT License URI: http://opensource.org/licenses/MIT @@ -88,6 +88,10 @@ Where 'blog' is the path to the subdirectory at which your blog resides. Project maintained on GitHub at [pfefferle/wordpress-activitypub](https://github.com/pfefferle/wordpress-activitypub). += 0.13.2 = + +* fix Follow issue AGAIN + = 0.13.1 = * fix Inbox issue