diff --git a/README.txt b/README.txt index be80c82..93c5bb6 100644 --- a/README.txt +++ b/README.txt @@ -5,7 +5,7 @@ Requires at least: 4.9.8 Requires PHP: 5.6.0 License: MIT License URI: https://github.com/jdormit/pterotype/blob/master/LICENSE -Stable tag: 1.4.2 +Stable tag: 1.4.3 Tested up to: 5.1.1 Pterotype expands your audience by giving your blog an ActivityPub stream, making it a part of the Fediverse. @@ -14,6 +14,9 @@ Pterotype expands your audience by giving your blog an ActivityPub stream, makin Pterotype expands your audience by giving your blog an ActivityPub stream, making it a part of the Fediverse. Users of Mastodon, Pleroma, and other Fediverse services will be able to follow and share your posts from the platform of their choice. == Changelog == +### 1.4.3 +- Fix the error from 1.4.2 the right way ¯\_(ツ)_/¯ + ### 1.4.2 - Fix an error where array_key_exists was being called on an argument that wasn't always an array diff --git a/includes/server/objects.php b/includes/server/objects.php index ffc078e..4bd06da 100644 --- a/includes/server/objects.php +++ b/includes/server/objects.php @@ -157,10 +157,11 @@ function get_object( $id ) { 'not_found', __( 'Object not found', 'pterotype' ), array( 'status' => 404 ) ); } - if ( is_array($object_json) && array_key_exists( 'object', $object_json ) ) { - $object_json = \pterotype\util\decompact_object( $object_json, array( 'object' ) ); + $object = json_decode( $object_json, true ); + if ( array_key_exists( 'object', $object ) ) { + $object = \pterotype\util\decompact_object( $object, array( 'object' ) ); } - return json_decode( $object_json, true ); + return $object; } function get_object_by_activitypub_id( $activitypub_id ) { diff --git a/pterotype.php b/pterotype.php index 912679d..121fc6b 100644 --- a/pterotype.php +++ b/pterotype.php @@ -3,7 +3,7 @@ Plugin Name: Pterotype Plugin URI: https://getpterotype.com Description: Pterotype expands your audience by giving your blog an ActivityPub stream, making it a part of the Fediverse. -Version: 1.4.2 +Version: 1.4.3 Author: Jeremy Dormitzer Author URI: https://jeremydormitzer.com License: MIT @@ -12,7 +12,7 @@ License URI: https://github.com/jdormit/blob/master/LICENSE require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; require_once plugin_dir_path( __FILE__ ) . 'includes/init.php'; -define( 'PTEROTYPE_VERSION', '1.4.2' ); +define( 'PTEROTYPE_VERSION', '1.4.3' ); define( 'PTEROTYPE_BLOG_ACTOR_SLUG', '-blog' ); define( 'PTEROTYPE_BLOG_ACTOR_USERNAME', 'blog' );