Version 1.4.3: actually fix the array_key_exists issue

This commit is contained in:
Jeremy Dormitzer 2019-03-14 22:55:48 -04:00
parent 5dbe71f75e
commit bea8f9addb
3 changed files with 10 additions and 6 deletions

View File

@ -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

View File

@ -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 ) {

View File

@ -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' );