You are here

function captcha_validate_case_insensitive_ignore_spaces in CAPTCHA 8

Same name and namespace in other branches
  1. 6.2 captcha.module \captcha_validate_case_insensitive_ignore_spaces()
  2. 7 captcha.module \captcha_validate_case_insensitive_ignore_spaces()

Validation function to tests case insensitive equality while ignoring spaces.

Parameters

string $solution: The solution of the test.

string $response: The response to the test.

Return value

bool TRUE when equal (ignoring spaces), FALSE otherwise.

1 string reference to 'captcha_validate_case_insensitive_ignore_spaces'
image_captcha_captcha in image_captcha/image_captcha.module
Implements hook_captcha().

File

./captcha.module, line 366
This module enables basic CAPTCHA functionality.

Code

function captcha_validate_case_insensitive_ignore_spaces($solution, $response) {
  return preg_replace('/\\s/', '', mb_strtolower($solution)) === preg_replace('/\\s/', '', mb_strtolower($response));
}