Closed Globulopolis closed 1 month ago
Hi! Code:
try { $app->triggerEvent('onCheckAnswer'); } catch (Exception $e) { ... }
will always return error. Because an empty $code value provided.
$code
So we need to add value like this
$app->triggerEvent('onCheckAnswer', array($app->input->getCmd('turnstile')));
in component or just add a fallback, before https://github.com/SharkyKZ/joomla-turnstile-plugin/blob/master/code/plugins/captcha/turnstile/turnstile.php#L218
$code = $code ?? $input->getCmd('turnstile');
This is not a valid way to use Captcha. Captcha plugins were never meant to use plugin events. They must be triggered through Joomla\CMS\Captcha\Captcha class.
Joomla\CMS\Captcha\Captcha
Hi! Code:
will always return error. Because an empty
$code
value provided.So we need to add value like this
$app->triggerEvent('onCheckAnswer', array($app->input->getCmd('turnstile')));
in component or just add a fallback, before https://github.com/SharkyKZ/joomla-turnstile-plugin/blob/master/code/plugins/captcha/turnstile/turnstile.php#L218
$code = $code ?? $input->getCmd('turnstile');