From 6795d707c82262fd3ff834fc58cd0632afeeb9f5 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Mon, 26 Jul 2021 09:48:51 +0200 Subject: [PATCH] fix Inbox issue fix `PHP Warning: Undefined variable $user_id in wp-content/plugins/activitypub/includes/rest/class-inbox.php on line 111` https://github.com/pfefferle/wordpress-activitypub/issues/88#issuecomment-886254210 --- README.md | 6 +++++- activitypub.php | 2 +- includes/rest/class-inbox.php | 10 +++------- readme.txt | 6 +++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ededaea..fad4ec5 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.0 +**Stable tag:** 0.13.1 **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.1 ### + +* fix Inbox issue + ### 0.13.0 ### * add Autor URL and WebFinger health checks diff --git a/activitypub.php b/activitypub.php index c98b50c..a52a6d5 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.0 + * Version: 0.13.1 * 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 2b99b62..4dcbd8c 100644 --- a/includes/rest/class-inbox.php +++ b/includes/rest/class-inbox.php @@ -34,11 +34,6 @@ class Inbox { 'args' => self::shared_inbox_request_parameters(), 'permission_callback' => '__return_true', ), - array( - 'methods' => \WP_REST_Server::READABLE, - 'callback' => array( '\Activitypub\Rest\Inbox', 'inbox_get' ), - 'permission_callback' => '__return_true', - ), ) ); @@ -52,7 +47,7 @@ class Inbox { ), array( 'methods' => \WP_REST_Server::READABLE, - 'callback' => array( '\Activitypub\Rest\Inbox', 'inbox_get' ), + 'callback' => array( '\Activitypub\Rest\Inbox', 'user_inbox_get' ), 'permission_callback' => '__return_true', ), ) @@ -94,7 +89,8 @@ class Inbox { * @param WP_REST_Request $request * @return WP_REST_Response */ - public static function inbox_get( $request ) { + public static function user_inbox_get( $request ) { + $user_id = $request->get_param( 'user_id' ); $page = $request->get_param( 'page', 0 ); /* diff --git a/readme.txt b/readme.txt index c816df4..e6dc463 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.0 +Stable tag: 0.13.1 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.1 = + +* fix Inbox issue + = 0.13.0 = * add Autor URL and WebFinger health checks