Commit d66a9c14 authored by wundo's avatar wundo

Fixed #125595.

Thanks Heine!
parent a8035238
......@@ -242,16 +242,17 @@ function captcha_captcha() {
$args = func_get_args();
$op = array_shift($args);
switch($op) {
case 'list':
return array("Math");
case 'generate':
$captcha_type = array_shift($args);
$result = array();
if($captcha_type == "Math") {
$x = rand(1,10);
$y = rand(1,10);
$result['value'] = (string)($x + $y);
case 'list':
return array("Math");
case 'generate':
$captcha_type = array_shift($args);
$result = array();
if($captcha_type == "Math") {
$answer = mt_rand(1, 20);
$x = mt_rand(1, $answer);
$y = $answer - $x;
$result['value'] = (string)($answer);
$result['form']['captcha_challenge'] = array (
'#type' => 'textfield',
'#title' => t('Math Question: What is %problem?', array('%problem' => $x .' + '. $y)),
......@@ -259,7 +260,7 @@ function captcha_captcha() {
'#weight' => 0,
'#required' => TRUE,
);
}
return $result;
}
return $result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment