Merge pull request #3070 from dhensby/patch-3

Oembed warning if GD function is missing
This commit is contained in:
Damian Mooyman 2014-05-02 08:37:38 +12:00
commit 73b2c7fe35

View File

@ -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];