Skip to content

Commit

Permalink
Fix (?) for GD version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Jul 9, 2015
1 parent e6f0a35 commit 4c5e1e8
Showing 1 changed file with 25 additions and 14 deletions.
39 changes: 25 additions & 14 deletions components/com_fabrik/helpers/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,33 @@ public static function loadLib($lib)
protected static function testGD()
{
$gd = array();
$GDfuncList = get_extension_funcs('gd');
ob_start();
@phpinfo(INFO_MODULES);
$output = ob_get_contents();
ob_end_clean();
$matches[1] = '';

if ($output !== '')
$output = '';
$gdversion = null;
$gd_info = null;

//$GDfuncList = get_extension_funcs('gd');
if (function_exists('gd_info'))
{
if (preg_match("/GD Version[ \t]*(<[^>]+>[ \t]*)+([^<>]+)/s", $output, $matches))
{
$gdversion = $matches[2];
}
else
$gd_info = gd_info();
$gdversion = $gd_info['GD Version'];
}
else
{
ob_start();
@phpinfo(INFO_MODULES);
$output = ob_get_contents();
ob_end_clean();
$matches[1] = '';
if ($output !== '')
{
return $gd;
if (preg_match("/GD Version[ \t]*(<[^>]+>[ \t]*)+([^<>]+)/s", $output, $matches))
{
$gdversion = $matches[2];
}
else
{
return $gd;
}
}
}

Expand Down

0 comments on commit 4c5e1e8

Please sign in to comment.