Fix fatal error if CAPTCHA is configured but disabled

This commit is contained in:
Kijin Sung 2025-12-24 21:45:02 +09:00
parent aaf3791a78
commit 04b158c544
2 changed files with 8 additions and 4 deletions

View file

@ -337,8 +337,12 @@ class SpamfilterController extends Spamfilter
if (count($target_actions))
{
$captcha_class = 'Rhymix\\Modules\\Spamfilter\\Captcha\\' . $config->captcha->type;
$captcha_class::init($config->captcha);
if (!class_exists($captcha_class))
{
return;
}
$captcha_class::init($config->captcha);
if (strncasecmp('proc', $obj->act, 4) === 0)
{
$captcha_class::check();