Only in modules/captcha/image_captcha/fonts: tiza.ttf diff -ur --exclude '*~' --exclude '*#' orig-modules/captcha/image_captcha/image_captcha.admin.inc modules/captcha/image_captcha/image_captcha.admin.inc --- orig-modules/captcha/image_captcha/image_captcha.admin.inc 2008-06-09 11:06:50.000000000 +0000 +++ modules/captcha/image_captcha/image_captcha.admin.inc 2009-04-10 19:54:01.000000000 +0000 @@ -51,6 +51,14 @@ '#description' => t('The code length influences the size of the image. Note that larger values make the image generation more CPU intensive.'), ); + // remove case sensitivity from test to make it easier to pass captcha + $form['image_captcha_code_settings']['captcha_ignore_case_sensitivity'] = array( + '#type' => 'checkbox', + '#title' => t('Ignore case sensitivity'), + '#description' => t('Ignore the user\'s case sensitivity in their answer. This will make it easier for users to pass CAPTCHA.'), + '#default_value' => variable_get('captcha_ignore_case_sensitivity', FALSE), + ); + // font related stuff $form['image_captcha_font_settings'] = array( '#type' => 'fieldset', Only in modules/captcha/image_captcha: image_captcha.admin.inc.orig diff -ur --exclude '*~' --exclude '*#' orig-modules/captcha/image_captcha/image_captcha.module modules/captcha/image_captcha/image_captcha.module --- orig-modules/captcha/image_captcha/image_captcha.module 2008-07-14 22:28:06.000000000 +0000 +++ modules/captcha/image_captcha/image_captcha.module 2009-04-10 19:54:01.000000000 +0000 @@ -149,7 +149,7 @@ /** * Implementation of hook_captcha */ -function image_captcha_captcha($op, $captcha_type='') { +function image_captcha_captcha($op, $captcha_type='', $response='') { switch ($op) { case 'list': // only offer image CAPTCHA if possible to generate an image CAPTCHA @@ -176,6 +176,22 @@ for ($i = 0; $i < $code_length; $i++) { $code .= $allowed_chars[array_rand($allowed_chars)]; } + + // check for case sensitivity + if (variable_get('captcha_ignore_case_sensitivity', FALSE)) { + // the operator has requested the test be insensitive + // set the test to all lower case characters + $code = strtolower($code); + // set a hook for the preprocessor so that the response + // from the user will also be set to lower case + $captcha['preprocess'] = TRUE; + } + else { + // reset preprocessor to FALSE + // just in case things change at runtime + $captcha['preprocess'] = FALSE; + } + // store the answer in $_SESSION for the image generator function (which happens in another http request) $seed = mt_rand(); $_SESSION['image_captcha'][$seed] = $code; @@ -201,6 +217,13 @@ ); return $result; } + case 'preprocess': + // this hook should only be enabled if the operator + // has selected case insensitivity. + // it is enabled in the generate process above + if ($captcha_type == 'Image') { + return strtolower($response); + } break; } } Only in modules/captcha/image_captcha: image_captcha.module.orig