Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-17366

Captcha disappears on error message from registration & posting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.3.13-RC1
    • 3.3.11, 3.3.12
    • None
    • PHP: 8.1.27
      DB: MySQL(i) 8.0.28-0ubuntu0.20.04.3

      I am noticing this with ReCaptcha V3 in particular.  During new user registration, if you cause an error message during user registration, such as...

      The password you entered is too short.
      The password does not contain the required characters.
      The password confirmation you entered is too short.
      The entered email address is already in use.

      ReCaptcha V3 seems to not display after the submit, so even if you fix those errors, you get the following error message.

      The solution you provided was incorrect

      It eventually comes back, but it can disappear again.

      The same issue seems to occur when posting in a forum while using ReCaptcha V3 with the Captcha+ extension and you have an error message occur there.  That first made me think it might be related to the extension, but as DavidIQ pointed out, since it also happens during user registration, it may be a core bug instead perhaps?

      My temporary workaround for the posting issue was to add the following code to line 1903 of posting.php, though I admit it may not be the best fix, but I think it seems to work for me at the moment. I'm assuming a similar workaround for the user registration part perhaps?

       
      else if ($config['captcha_plugin'] == 'core.captcha.plugins.recaptcha_v3' && $config['enable_post_confirm'] && ($mode == 'post' || $mode == 'reply' || $mode == 'quote') && ($submit || $preview) && count($error) > 0 )

      {

      if( !isset($captcha) )

      {

      $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);

      $captcha->init(CONFIRM_POST);

      }

      if($captcha->is_solved() === false)

      {

      $template->assign_vars(array(

      'S_CONFIRM_CODE' => true,

      'CAPTCHA_TEMPLATE' => $captcha->get_template(),

      ));

      }

       

       

      Thanks!

       

            Marc Marc
            kylesands kylesands
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: