captcha-queries.php: refactor NativeCaptchaQuery to use DI

This commit is contained in:
Zankaria
2024-08-15 15:17:54 +02:00
parent 933594194c
commit a275d04efa
3 changed files with 18 additions and 6 deletions

View File

@@ -631,8 +631,8 @@ if (isset($_POST['delete'])) {
try {
// With our custom captcha provider
if ($config['captcha']['enabled'] || ($post['op'] && $config['new_thread_capt'])) {
$query = new NativeCaptchaQuery($context->get(HttpDriver::class), $config['domain'], $config['captcha']['provider_check']);
$success = $query->verify($config['captcha']['extra'], $_POST['captcha_text'], $_POST['captcha_cookie']);
$query = $context->get(NativeCaptchaQuery::class);
$success = $query->verify($_POST['captcha_text'], $_POST['captcha_cookie']);
if (!$success) {
error(