From b20113a1e79efc4a65e91bb917ca1901ca16acfe Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 2 Dec 2024 12:41:25 +0100 Subject: [PATCH] `CaptchaFormField` field did not check whether the given captcha type is available ref https://www.woltlab.com/community/thread/309908-passwort-vergessen-funktioniert-nicht/ --- .../form/builder/field/CaptchaFormField.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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; } /** -- 2.20.1