From: Marcel Werk Date: Mon, 2 Dec 2024 11:41:25 +0000 (+0100) Subject: `CaptchaFormField` field did not check whether the given captcha type is available X-Git-Tag: 6.1.2_dev_1~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b20113a1e79efc4a65e91bb917ca1901ca16acfe;p=GitHub%2FWoltLab%2FWCF.git `CaptchaFormField` field did not check whether the given captcha type is available ref https://www.woltlab.com/community/thread/309908-passwort-vergessen-funktioniert-nicht/ --- diff --git a/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php index 40cc464b2a..b21701ba81 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php @@ -126,7 +126,17 @@ final class CaptchaFormField extends AbstractFormField implements IObjectTypeFor return $this; } - return $this->defaultObjectType($objectType); + $this->defaultObjectType($objectType); + + if ($this->objectType !== null) { + $captchaHandler = $this->getObjectType()->getProcessor(); + \assert($captchaHandler instanceof ICaptchaHandler); + if (!$captchaHandler->isAvailable()) { + $this->objectType = null; + } + } + + return $this; } /**