Commit e603853d authored by soxofaan's avatar soxofaan

fixed some issues reported by coder module

parent 1a74813f
......@@ -147,7 +147,7 @@ function captcha_admin_settings() {
$form['captcha_log_wrong_responses'] = array(
'#type' => 'checkbox',
'#title' => t('Log wrong responses'),
'#description' => t('Report information about wrong responses to the !watchdoglog.', array('!watchdoglog' => l('log', 'admin/logs/watchdog'))),
'#description' => t('Report information about wrong responses to the !log.', array('!log' => l('log', 'admin/reports/dblog'))),
'#default_value' => variable_get('captcha_log_wrong_responses', FALSE),
);
// submit button
......
......@@ -22,12 +22,12 @@ function captcha_help($path, $arg) {
switch ($path) {
case 'admin/help#captcha':
$output = '<p>'. t('"CAPTCHA" is an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart". It is typically a challenge-response test to determine whether the user is human. The CAPTCHA module is a tool to fight automated submission by malicious users (spamming) of for example comments forms, user registration forms, guestbook forms, etc. You can extend the desired forms with an additional challenge, which should be easy for a human to solve correctly, but hard enough to keep automated scripts and spam bots out.') .'</p>';
$output .= '<p>'. t('Note that the CAPTCHA module interacts with page caching (see <a href="!performancesettings">performance settings</a>). Because the challenge should be unique for each generated form, the caching of the page it appears on is prevented. Make sure that these forms do not appear on too many pages or you will lose much caching efficiency. For example, if you put a CAPTCHA on the user login block, which typically appears on each page for anonymous visitors, caching will practically be disabled. The comment submission forms are another example. In this case you should set the "%commentlocation" to "%separatepage" in <a href="!commentsettings">the comment settings</a> for better caching efficiency.' ,
$output .= '<p>'. t('Note that the CAPTCHA module interacts with page caching (see <a href="!performancesettings">performance settings</a>). Because the challenge should be unique for each generated form, the caching of the page it appears on is prevented. Make sure that these forms do not appear on too many pages or you will lose much caching efficiency. For example, if you put a CAPTCHA on the user login block, which typically appears on each page for anonymous visitors, caching will practically be disabled. The comment submission forms are another example. In this case you should set the "%commentlocation" to "%separatepage" in the comment settings of the relevant <a href="!contenttypes">content types</a> for better caching efficiency.' ,
array(
'!performancesettings' => url('admin/settings/performance'),
'%commentlocation' => t('Location of comment submission form'),
'%separatepage' => t('Display on separate page'),
'!commentsettings' => url('admin/content/comment/settings'),
'!contenttypes' => url('admin/content/types'),
)
) .'</p>';
$output .= '<p>'. t('CAPTCHA is a trademark of Carnegie Mellon University.') .'</p>';
......@@ -37,7 +37,7 @@ function captcha_help($path, $arg) {
case 'admin/user/captcha/captcha/settings':
return t('<p>A CAPTCHA can be added to virtually each Drupal form. Some default forms are already provided in the form list, but arbitrary forms can be easily added and managed when the option "%adminlinks" is enabled.</p><p>Users with the "%skipcaptcha" <a href="@perm">permission</a> won\'t be offered a challenge. Be sure to grant this permission to the trusted users (e.g. site administrators). If you want to test a protected form, be sure to do it as a user without the "%skipcaptcha" permission (e.g. as anonymous user).</p>',
array(
'@perm' => url('admin/user/access'),
'@perm' => url('admin/user/permissions'),
'%adminlinks' => t('Add CAPTCHA administration links to forms'),
'%skipcaptcha' => 'skip CAPTCHA',
));
......
......@@ -25,7 +25,7 @@ function image_captcha_image($seed=NULL) {
$image = @_image_captcha_generate_image($code);
// check of generation was successful
if (!$image) {
watchdog('CAPTCHA', t('Generation of image CAPTCHA failed. Check your image CAPTCHA configuration and especially the used font.'), WATCHDOG_ERROR);
watchdog('CAPTCHA', 'Generation of image CAPTCHA failed. Check your image CAPTCHA configuration and especially the used font.', array(), WATCHDOG_ERROR);
exit();
}
// Send the image resource as an image to the client
......@@ -251,7 +251,8 @@ function _image_captcha_image_generator_print_string(&$image, $width, $height, $
// draw character
if ($font == 'BUILTIN') {
imagestring($image, 5, $pos_x, $pos_y, $character, $color);
} else {
}
else {
imagettftext($image, $font_size, 0, $pos_x, $pos_y, $color, realpath($font), $character);
}
// shift cursor
......
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