From 77d28213473e5daee7319aebfdf2ae281d69bb39 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 14 Mar 2019 22:40:16 -0400 Subject: [PATCH] Check for array before calling array_key_exists --- includes/server/objects.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/server/objects.php b/includes/server/objects.php index c34a8a0..ffc078e 100644 --- a/includes/server/objects.php +++ b/includes/server/objects.php @@ -157,6 +157,9 @@ 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' ) ); + } return json_decode( $object_json, true ); }