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);
  }

Comments

Cadencia created an issue. See original summary.

keshavv’s picture

Status: Active » Closed (won't fix)

This issue is already fixed. Please check with the latest code.
Thank you.

mlncn’s picture

Status: Closed (won't fix) » Needs work

This is a critical issue and warrants a release before deeming it fixed, please.

mlncn’s picture

Version: 2.0.4 » 3.0.1
megakeegman’s picture

Version: 3.0.1 » 2.x-dev

This error still occurs in the 2.x-dev branch

keshavv’s picture

Status: Needs work » Needs review
StatusFileSize
new887 bytes

Created patch for 2.x branch from 3.x as it is already fixed there.
Please review.
Thank you.

Status: Needs review » Needs work

The last submitted patch, 6: 3378590-6.patch, failed testing. View results

keshavv’s picture

Status: Needs work » Needs review
StatusFileSize
new8.38 KB

Fix failed tests.

Status: Needs review » Needs work

The last submitted patch, 8: 3378590-8.patch, failed testing. View results

keshavv’s picture

Status: Needs work » Needs review
StatusFileSize
new8.38 KB

Fix PHPUnit test cases.

keshavv’s picture

StatusFileSize
new15.62 KB
megakeegman’s picture

Status: Needs review » Reviewed & tested by the community

Thanks very much, I have just tested the above patch (labeled patch 12 but in comment 11) and it appears to be working correctly on the 2.x branch.

anybody’s picture

Assigned: Unassigned » grevil

Thank you, we're on it!

anybody’s picture

This is fixed in 3.x but due to the chances in CAPTCHA module, this now also needs to be fixed in 2.x

anybody’s picture

Assigned: grevil » Unassigned
Status: Reviewed & tested by the community » Fixed

Fixed, I'll tag a new 2.0.5 release. Thank you all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.