Handle timeout-or-duplicate in RecaptchaHandler
authorMarkus <markus28988@gmail.com>
Thu, 1 Jun 2017 17:31:16 +0000 (19:31 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 1 Jun 2017 18:17:04 +0000 (20:17 +0200)
wcfsetup/install/files/lib/system/recaptcha/RecaptchaHandler.class.php

index a9820e7494be436089e2f76fc615fbb1eceb57b6..b3c8e5708946e94b6d5df1f360e7b34429b03e57 100644 (file)
@@ -60,6 +60,7 @@ class RecaptchaHandler extends SingletonFactory {
        const ERROR_INCORRECT_PARAMS = 'verify-params-incorrect';
        const ERROR_INVALID_REFFERER = 'invalid-referrer';
        const ERROR_NOT_REACHABLE = 'recaptcha-not-reachable';
+       const ERROR_TIMEOUT_OR_DUPLICATE = 'timeout-or-duplicate';
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -136,6 +137,11 @@ class RecaptchaHandler extends SingletonFactory {
                                throw new UserInputException('recaptchaString', 'false');
                                break;
                        
+                       case self::ERROR_TIMEOUT_OR_DUPLICATE:
+                               // User was to slow to fill the captcha.
+                               throw new UserInputException('recaptchaString', 'false');
+                               break;
+                               
                        default:
                                throw new SystemException('reCAPTCHA returned the following error: '.$response);
                }