Skip to content

Commit

Permalink
Merge pull request #6 from celcius-digital-agency/master
Browse files Browse the repository at this point in the history
Fix possible undefined index exceptions in Vimeo parser
  • Loading branch information
chojnicki authored Sep 27, 2019
2 parents 9f9280d + 55ffbb7 commit 8acf9fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/parsers/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
'title' => ! empty($json['title']) ? $json['title'] : null,
'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
];
Expand Down

0 comments on commit 8acf9fc

Please sign in to comment.