Skip to content

Commit

Permalink
[FlickrBridge] Fix missing scheme for image URLs
Browse files Browse the repository at this point in the history
References #754
  • Loading branch information
logmanoriginal committed Jul 23, 2018
1 parent 43bb17f commit afb4de3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions bridges/FlickrBridge.php
Expand Up @@ -149,7 +149,7 @@ private function extractEnclosures($model) {
$areas[$size['width'] * $size['height']] = $size['url'];
}

return array(max($areas));
return array($this->fixURL(max($areas)));

}

Expand All @@ -168,7 +168,18 @@ private function extractContentImage($model) {

}

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;

}

Expand Down

0 comments on commit afb4de3

Please sign in to comment.