mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Oembed warning if GD function is missing
Silencing errors from a function is terrible so I've stopped that. I've also added detection for if `imagecreatefromstring` is a declared function and a useful error is thrown if not
This commit is contained in:
parent
346990c877
commit
0e58e97eea
@ -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…
x
Reference in New Issue
Block a user