Fix bug #46455 - Make sure can_load_dll() is available.

Authorised by: acydburn

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9595 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Andreas Fischer 2009-06-15 11:21:27 +00:00
parent 8c79920a55
commit a49eef594b
2 changed files with 29 additions and 7 deletions

View file

@ -38,7 +38,6 @@ class phpbb_captcha_gd extends phpbb_default_captcha
'captcha_gd_wave' => 'CAPTCHA_GD_WAVE', 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE',
'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE', 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE',
'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS', 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS',
); );
function phpbb_captcha_gd() function phpbb_captcha_gd()
@ -59,7 +58,19 @@ class phpbb_captcha_gd extends phpbb_default_captcha
function is_available() function is_available()
{ {
return (@extension_loaded('gd') || can_load_dll('gd')); global $phpbb_root_path, $phpEx;
if (@extension_loaded('gd'))
{
return true;
}
if (!function_exists('can_load_dll'))
{
include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
}
return can_load_dll('gd');
} }
function get_name() function get_name()
@ -79,7 +90,6 @@ class phpbb_captcha_gd extends phpbb_default_captcha
$user->add_lang('acp/board'); $user->add_lang('acp/board');
$config_vars = array( $config_vars = array(
'enable_confirm' => 'REG_ENABLE', 'enable_confirm' => 'REG_ENABLE',
'enable_post_confirm' => 'POST_ENABLE', 'enable_post_confirm' => 'POST_ENABLE',

View file

@ -47,7 +47,19 @@ class phpbb_captcha_gd_wave extends phpbb_default_captcha
function is_available() function is_available()
{ {
return (@extension_loaded('gd') || can_load_dll('gd')); global $phpbb_root_path, $phpEx;
if (@extension_loaded('gd'))
{
return true;
}
if (!function_exists('can_load_dll'))
{
include($phpbb_root_path . 'includes/functions_install.' . $phpEx);
}
return can_load_dll('gd');
} }
function get_name() function get_name()