CAPTCHA_DEFAULT_VALIDATION_CASE_SENSITIVE

Created on 1 August 2023, 11 months ago
Updated 9 August 2023, 11 months ago

Problem/Motivation

Execution of riddler fails with php crash

Steps to reproduce

Create a riddle, put it in a form and try it!

Proposed resolution

Either include the captcha constants in the riddler module, or hard-code the values in the module file.

replace this:

switch (\Drupal::config('captcha.settings')->get('default_validation')) {
    case CAPTCHA_DEFAULT_VALIDATION_CASE_SENSITIVE:
      return in_array($captcha_response, $solutions);

    case CAPTCHA_DEFAULT_VALIDATION_CASE_INSENSITIVE:
      return in_array(strtolower($captcha_response), $isolutions);
  }

with this:

switch (\Drupal::config('captcha.settings')->get('default_validation')) {
    case 0:
      return in_array($captcha_response, $solutions);

    case 1:
      return in_array(strtolower($captcha_response), $isolutions);
  }
🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇳🇿New Zealand Cadencia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024