Skip to content

Commit

Permalink
[DribbbleBridge] Fix pictures parsing (#1911)
Browse files Browse the repository at this point in the history
corenting authored Jan 20, 2021
1 parent 3534193 commit fbbd6a0
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
@@ -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 fbbd6a0

Please sign in to comment.