From e8db3ec9d5b6f6fd301941f407942bc7ed2cae8c Mon Sep 17 00:00:00 2001 From: Jochen Sengier Date: Fri, 27 Sep 2019 13:36:14 +0200 Subject: [PATCH] Only manipulate thumbnail_url attribute if it's not empty --- src/parsers/Vimeo.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/parsers/Vimeo.php b/src/parsers/Vimeo.php index 767c3e7..2066e7a 100644 --- a/src/parsers/Vimeo.php +++ b/src/parsers/Vimeo.php @@ -54,13 +54,11 @@ public function getVideoInfoWithAPI($id) $response = VideoPlatformsParser::HTTPGet($url); $json = json_decode($response, true); - $json['thumbnail_url'] = str_replace('_295x166', '', $json['thumbnail_url']); - return [ 'id' => $id, 'title' => $json['title'], 'description' => ! empty($json['description']) ? $json['description'] : null, - 'thumbnail' => ! empty($json['thumbnail_url']) ? $json['thumbnail_url'] : null, + 'thumbnail' => ! empty($json['thumbnail_url']) ? str_replace('_295x166', '', $json['thumbnail_url']) : null, 'duration' => ! empty($json['duration']) ? $json['duration'] : 0, 'api' => true ];