greggilbert/recaptcha

extend vs extendImplicit?

jmp909 opened this issue · 2 comments

is there a reason extendImplicit is used?

I don't want to run the recaptcha check if it has not been supplied

eg with extend the recaptcha check would not run when using required|recaptcha if I don't complete the recaptcha. it will just fail due to the required

because extendImplicit is used, then both rules run and 2 errors are returned

  • The g-recaptcha-response field is required.
  • Please ensure that you are a human!

theoretically both aren't required as they mean the same thing?

thanks
J

actually I've just noticed if you set both responses the same then only one is shown

'g-recaptcha-response.required' => 'Please complete the captcha',
'g-recaptcha-response.recaptcha' => 'Please complete the captcha',

No particular reason extendImplicit is being used. There is a semantic difference between required and recaptcha, though, namely that the first is whether or not there is a value in the box, and the second is whether or not that value is valid.