SharkyKZ / plg_captcha_friendlycaptcha

Friendly Captcha anti-spam plugin for Joomla!
GNU General Public License v2.0
10 stars 2 forks source link

Captcha doesn't work on Membership Pro form #2

Closed rogernclarke closed 2 years ago

rogernclarke commented 2 years ago

I've tested this plugin on a contact form and it works great. But on the Membership Pro application form it doesn't read the code from the submitted data.

As the Google Recaptcha plugin works on the form I checked to see how it works and I can get your plugin to work on the Membership Pro form by adding the following code at the start of onCheckAnswer: $input = \JFactory::getApplication()->input; $code = $code ? $code : $input->get('dynamic_recaptcha_1', '', 'string');

Is that something that you can add into your plugin?

SharkyKZ commented 2 years ago

No, this should be fixed in Membership Pro. The problem is that it's using different field names when rendering the field (dynamic_recaptcha_1) and when checking the answer (recaptcha_response_field).

components/com_osmembership/site/view/register.php:

$this->captcha = Captcha::getInstance($captchaPlugin)->display('dynamic_recaptcha_1', 'dynamic_recaptcha_1', 'required');

components/com_osmembership/site/controller/captcha.php:

return Captcha::getInstance($captchaPlugin)->checkAnswer($input->post->get('recaptcha_response_field', null, 'string'));
rogernclarke commented 2 years ago

Ah, good answer. I'll raise this as a bug with them. Thanks, Roger