diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php index 06178ece50..108e8f686e 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php @@ -38,9 +38,8 @@ class phpbb_captcha_gd extends phpbb_default_captcha 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE', 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE', 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS', - ); - + function phpbb_captcha_gd() { global $phpbb_root_path, $phpEx; @@ -59,7 +58,19 @@ class phpbb_captcha_gd extends phpbb_default_captcha 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() @@ -79,7 +90,6 @@ class phpbb_captcha_gd extends phpbb_default_captcha $user->add_lang('acp/board'); - $config_vars = array( 'enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', @@ -125,7 +135,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha )); } } - + function execute_demo() { global $config; @@ -138,7 +148,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha parent::execute_demo(); $config = $config_old; } - + } ?> \ No newline at end of file diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php index 4198dcdf5b..ce678b6d29 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_wave_plugin.php @@ -47,7 +47,19 @@ class phpbb_captcha_gd_wave extends phpbb_default_captcha 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()