mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-25 21:32:51 +09:00
Fix #2008 Add support for Cloudflare Turnstile
This commit is contained in:
parent
32ffc94dee
commit
bd44b4ef54
5 changed files with 80 additions and 10 deletions
|
|
@ -225,7 +225,7 @@ class spamfilterController extends spamfilter
|
|||
function triggerCheckCaptcha(&$obj)
|
||||
{
|
||||
$config = ModuleModel::getModuleConfig('spamfilter');
|
||||
if (!isset($config) || !isset($config->captcha) || $config->captcha->type !== 'recaptcha' || !$config->captcha->site_key || !$config->captcha->secret_key)
|
||||
if (!isset($config) || !isset($config->captcha) || !in_array($config->captcha->type, ['recaptcha','turnstile']) || !$config->captcha->site_key || !$config->captcha->secret_key)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -261,15 +261,15 @@ class spamfilterController extends spamfilter
|
|||
if (count($target_actions))
|
||||
{
|
||||
include_once __DIR__ . '/spamfilter.lib.php';
|
||||
spamfilter_reCAPTCHA::init($config->captcha);
|
||||
spamfilter_captcha::init($config->captcha);
|
||||
|
||||
if (strncasecmp('proc', $obj->act, 4) === 0)
|
||||
{
|
||||
spamfilter_reCAPTCHA::check();
|
||||
spamfilter_captcha::check();
|
||||
}
|
||||
else
|
||||
{
|
||||
$captcha = new spamfilter_reCAPTCHA();
|
||||
$captcha = new spamfilter_captcha();
|
||||
$captcha->setTargetActions($target_actions);
|
||||
$captcha->addScripts();
|
||||
Context::set('captcha', $captcha);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue