diff --git a/src/Intervention/Image/AbstractDecoder.php b/src/Intervention/Image/AbstractDecoder.php index 74e158ad..b5d78ca2 100644 --- a/src/Intervention/Image/AbstractDecoder.php +++ b/src/Intervention/Image/AbstractDecoder.php @@ -61,7 +61,18 @@ abstract class AbstractDecoder */ public function initFromUrl($url) { - if ($data = @file_get_contents($url)) { + + $options = array( + 'http' => array( + 'method'=>"GET", + 'header'=>"Accept-language: en\r\n". + "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1216.0 Safari/537.2\r\n" + ) + ); + + $context = stream_context_create($options); + + if ($data = @file_get_contents($url, false, $context)) { return $this->initFromBinary($data); }