Index: captcha.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.module,v
retrieving revision 1.21
diff -u -F^f -r1.21 captcha.module
--- captcha.module 12 Feb 2006 08:54:56 -0000 1.21
+++ captcha.module 26 Feb 2006 04:45:28 -0000
@@ -29,11 +29,17 @@ function captcha_menu($may_cache) {
$items = array();
$suffix = '';
- if (arg(2)!=null) $suffix='/'.arg(2);
-
- $items[] = array('path' => 'captcha/image'.$suffix, 'title' => t('captcha image'),
- 'callback' => _captcha_call('_captcha_image'), 'access' => user_access('access captchas'),
- 'type' => MENU_CALLBACK);
+
+ if ($may_cache) {
+ if (arg(2)!=null) $suffix='/'.arg(2);
+ $items[] = array(
+ 'path' => 'captcha/image'.$suffix, 'title' => t('captcha image'),
+ 'callback' => '_captcha_call',
+ 'callback arguments' => array('_captcha_image'),
+ 'access' => user_access('access captchas'),
+ 'type' => MENU_CALLBACK
+ );
+ }
return $items;
}
@@ -211,7 +217,7 @@ function _captcha_font_list() {
function _captcha_call($func) {
_captcha_load();
- //if (function_exists($func)) call_user_func_array($func, array());
+ if (function_exists($func)) call_user_func_array($func, array());
}
/**
Index: captcha_image.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha_image.inc,v
retrieving revision 1.1
diff -u -F^f -r1.1 captcha_image.inc
--- captcha_image.inc 30 Jan 2006 04:38:50 -0000 1.1
+++ captcha_image.inc 26 Feb 2006 04:45:28 -0000
@@ -1,22 +1,14 @@
function _captcha_image_challenge(&$form) {
-
- $form['captcha_image'] = array (
- '#type' => 'item',
- '#title' => 'captcha image',
- '#weight' => 0,
- '#value' => '
',
- );
-
$form['captcha_response'] = array (
'#type' => 'textfield',
- '#title' => t('Word'),
+ '#title' => t('Captcha Validation'),
'#defaultvalue' => '',
- '#weight' => 0,
'#required' => TRUE,
'#validate' => array('_captcha_validate' => array()),
- '#description' => t('Please type in the letters/numbers that are shown in the image above.')
+ '#description' => t('Please type in the letters/numbers that are shown in the image above.'),
+ '#prefix' => '
',
);
return $form;