sql_escape($user->session_id) . "' AND confirm_id = '" . $db->sql_escape($confirm_id) . "' AND confirm_type = $type"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); // If we have a row then grab data else create a new id if (!$row) { exit; } // Some people might want the olde style CAPTCHA even if they have GD enabled, this also saves us from people who have GD but no TTF $policy_modules = array('policy_entropy', 'policy_3dbitmap'); if (function_exists('imagettfbbox') && function_exists('imagettftext')) { $policy_modules = array_merge($policy_modules, array('policy_overlap', 'policy_shape', 'policy_cells', 'policy_stencil', 'policy_composite')); } foreach ($policy_modules as $key => $name) { if ($config[$name] === '0') { unset($policy_modules[$key]); } } $policy = ''; if (@extension_loaded('gd') && sizeof($policy_modules)) { include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); $policy = $policy_modules[array_rand($policy_modules)]; } else { include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx); } $captcha = new captcha(); $captcha->execute($row['code'], $policy); exit; } } ?>