Throw `UserInputException` insteadof `InvalidArgumentException` for invalid captchas
authorjoshuaruesweg <ruesweg@woltlab.com>
Sat, 20 Mar 2021 16:48:03 +0000 (17:48 +0100)
committerjoshuaruesweg <ruesweg@woltlab.com>
Sat, 20 Mar 2021 16:48:03 +0000 (17:48 +0100)
See 80d79b25e7c027b48487bc822faf4256534f22e2

wcfsetup/install/files/lib/system/captcha/RecaptchaHandler.class.php

index d39ea7b90eb30f5e7e8e1a37719a40c2d90f2012..fced19c4949838493b9164662ae866387f99a1a4 100644 (file)
@@ -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(