From 297a6cf19182c8be2912a1911d70acd16b97ef1d Mon Sep 17 00:00:00 2001 From: Florent Machen Date: Fri, 25 Mar 2022 00:27:23 +0100 Subject: [PATCH] [WorldCosplayBridge] fix Cosplayer API response structure (#2307) --- bridges/WorldCosplayBridge.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bridges/WorldCosplayBridge.php b/bridges/WorldCosplayBridge.php index 05d624845e4..b60d7948ac1 100644 --- a/bridges/WorldCosplayBridge.php +++ b/bridges/WorldCosplayBridge.php @@ -100,13 +100,15 @@ public function collectData() { $list = $json->list; foreach($list as $img) { - $item = array(); - $item['uri'] = self::URI . substr($img->photo->url, 1); - $item['title'] = $img->photo->subject; - $item['timestamp'] = $img->photo->created_at; - $item['author'] = $img->member->global_name; - $item['enclosures'] = array($img->photo->large_url); - $item['uid'] = $img->photo->id; + $image = isset($img->photo) ? $img->photo : $img; + $item = array( + 'uri' => self::URI . substr($image->url, 1), + 'title' => $image->subject, + 'timestamp' => $image->created_at, + 'author' => $img->member->global_name, + 'enclosures' => array($image->large_url), + 'uid' => $image->id, + ); $item['content'] = sprintf( self::CONTENT_HTML, $item['uri'],