From 067f2d1d54598de3547fae674e8ed0cc8ae0a86f Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Sat, 20 Mar 2021 17:48:03 +0100 Subject: [PATCH] Throw `UserInputException` insteadof `InvalidArgumentException` for invalid captchas See 80d79b25e7c027b48487bc822faf4256534f22e2 --- .../files/lib/system/captcha/RecaptchaHandler.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/captcha/RecaptchaHandler.class.php b/wcfsetup/install/files/lib/system/captcha/RecaptchaHandler.class.php index d39ea7b90e..fced19c494 100644 --- a/wcfsetup/install/files/lib/system/captcha/RecaptchaHandler.class.php +++ b/wcfsetup/install/files/lib/system/captcha/RecaptchaHandler.class.php @@ -112,7 +112,8 @@ class RecaptchaHandler implements ICaptchaHandler } elseif ($type === 'invisible') { $key = RECAPTCHA_PRIVATEKEY_INVISIBLE; } else { - throw new \InvalidArgumentException('$type must be either v2 or invisible.'); + // The bot modified the `recaptcha-type` form field. + throw new UserInputException('recaptchaString', 'false'); } $request = new HTTPRequest( -- 2.20.1