From afb4de318b18147675abade66104f630cca3b841 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Mon, 23 Jul 2018 20:14:38 +0200 Subject: [PATCH] [FlickrBridge] Fix missing scheme for image URLs References #754 --- bridges/FlickrBridge.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bridges/FlickrBridge.php b/bridges/FlickrBridge.php index 4d132c7..6dd3431 100644 --- a/bridges/FlickrBridge.php +++ b/bridges/FlickrBridge.php @@ -149,7 +149,7 @@ class FlickrBridge extends BridgeAbstract { $areas[$size['width'] * $size['height']] = $size['url']; } - return array(max($areas)); + return array($this->fixURL(max($areas))); } @@ -168,7 +168,18 @@ class FlickrBridge extends BridgeAbstract { } - return min($areas); + return $this->fixURL(min($areas)); + + } + + private function fixURL($url) { + + // For some reason the image URLs don't include the protocol (https) + if(strpos($url, '//') === 0) { + $url = 'https:' . $url; + } + + return $url; }