mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #3070 from dhensby/patch-3
Oembed warning if GD function is missing
This commit is contained in:
commit
73b2c7fe35
@ -267,7 +267,10 @@ class Oembed_Result extends ViewableData {
|
||||
if(!$data) {
|
||||
// if the response is no valid JSON we might have received a binary stream to an image
|
||||
$data = array();
|
||||
$image = @imagecreatefromstring($body);
|
||||
if (!function_exists('imagecreatefromstring')) {
|
||||
throw new LogicException('imagecreatefromstring function does not exist - Please make sure GD is installed');
|
||||
}
|
||||
$image = imagecreatefromstring($body);
|
||||
if($image !== FALSE) {
|
||||
preg_match("/^(http:\/\/)?([^\/]+)/i", $this->url, $matches);
|
||||
$protocoll = $matches[1];
|
||||
|
Loading…
Reference in New Issue
Block a user