From fbbd6a02c6240efa56032b46341bcce9aa70bc19 Mon Sep 17 00:00:00 2001 From: Corentin Garcia Date: Wed, 20 Jan 2021 18:26:15 +0100 Subject: [PATCH] [DribbbleBridge] Fix pictures parsing (#1911) --- bridges/DribbbleBridge.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bridges/DribbbleBridge.php b/bridges/DribbbleBridge.php index 01cfb21ab3c..e3452658637 100644 --- a/bridges/DribbbleBridge.php +++ b/bridges/DribbbleBridge.php @@ -86,7 +86,7 @@ private function findJsonForShot($shot, $json){ private function getImageTag($preview_path, $title){ return sprintf( - '
%s', + '
%s', $this->getFullSizeImagePath($preview_path), $preview_path, $title @@ -94,6 +94,11 @@ private function getImageTag($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); } }