Skip to content

Commit

Permalink
[DribbbleBridge] Fix pictures parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
corenting committed Jan 12, 2021
1 parent 3c285d5 commit 65b42bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bridges/DribbbleBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,19 @@ private function findJsonForShot($shot, $json){

private function getImageTag($preview_path, $title){
return sprintf(
'<br /> <a href="%s"><img src="%s" alt="%s" /></a>',
'<br /> <a href="%s"><img srcset="%s" alt="%s" /></a>',
$this->getFullSizeImagePath($preview_path),
$preview_path,
$title
);
}

private function getFullSizeImagePath($preview_path){
return explode('?compress=1', $preview_path)[0];
// Get last image from srcset
$src_set_urls = explode(',', $preview_path);
$url = end($src_set_urls);
$url = explode(' ', $url)[1];

return htmlspecialchars_decode($url);
}
}

0 comments on commit 65b42bf

Please sign in to comment.