Closed (fixed)
Project:
CAPTCHA
Version:
5.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
24 Aug 2007 at 16:44 UTC
Updated:
4 Oct 2007 at 02:01 UTC
Jump to comment: Most recent file
Here is some output from the Coder module review:
return '<p>' . t('A captcha is a tool to fight automated spam submission of forms (e.g. user registration forms, comment forms, guestbook forms, etc.) by malicious users. A captcha is an extra field (or several fields) on a form presented to the user. It embodies a challenge, which should be easy for a normal human to solve (e.g. a simple math problem), but hard enough to keep automated scripts and spam bots out. Users with the \'skip captcha\' <a href="@perm">permission</a> won\'t be offered a captcha. Be sure to grant this permission to the trusted users (e.g. site administrators).', array('@perm' => url('admin/user/access'))) . '</p>';
function _captcha_available_challenge_types(){
foreach(module_implements('captcha') as $module) {
foreach($result as $challenge) {
drupal_set_message(t('Disabled captcha for form %form_id.', array('%form_id'=>$form_id)));
drupal_set_message(t('Deleted captcha for form %form_id.', array('%form_id'=>$form_id)));
$form['captcha_types'][$captcha_point->form_id]['captcha_type']['#attributes'] = array('class'=>'error');
if(!variable_get('captcha_persistence', TRUE) && ($_SESSION['captcha'][$form_id]['success'] === TRUE)) {
array('%type' => $captcha_point->type, '%module' => $captcha_point->module, '%form_id'=> $form_id)),
$form['captcha']['captcha_solution'] = array (
$form['captcha']['captcha_token'] = array (
foreach(element_children($form) as $key) {
foreach(module_implements('captcha') as $module) {
foreach($challenges as $challenge) {
switch($op) {
$result['form']['captcha_response'] = array (image_captcha.module
Include the CVS keyword $Id$ in each file
Line 19: string concatenation should be formatted without a space separating the operators (dot .) and a quote
return '<p>' . t('The image captcha is the popular captcha type where a random text code is obfuscated in an image.') . '</p>';Line 84: Control statements should have one space between the control keyword and opening parenthesis
foreach($fontsdirectories as $fontsdirectory) {Line 85: Control statements should have one space between the control keyword and opening parenthesis
foreach(file_scan_directory($fontsdirectory, '\.[tT][tT][fF]$') as $filename => $font) {Line 180: Control statements should have one space between the control keyword and opening parenthesis
switch($op) {text_captcha.module
Include the CVS keyword $Id$ in each file
Line 17: string concatenation should be formatted without a space separating the operators (dot .) and a quote
return '<p>' . t('This text based captcha presents a captcha phrase of a given number of words and the visitor is asked to enter the n\'th word.') . '</p>';Line 106: missing space after comma
$o = mt_rand(0,1); // randomly start with vowel or consonantsLine 127: Control statements should have one space between the control keyword and opening parenthesis
foreach($keys as $key) {Line 134: missing space after comma
$words[] = _text_captcha_generate_nonsense_word(mt_rand(3,7));Line 159: Control statements should have one space between the control keyword and opening parenthesis
switch($op) {Line 172: Functions should be called with no spaces between the function name
$result['form']['captcha_response'] = array (Going by the Drupal coding standards is probably a good thing ;) .
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | code_style_1.patch | 10.09 KB | soxofaan |
| #4 | captchacoder.module.patch | 7.8 KB | robloach |
| #3 | captcha_api_coderstuff.patch | 1.32 KB | soxofaan |
Comments
Comment #1
soxofaan commentedI'm working on the image captcha module right now (mostly cleanup stuff, streamlining, making the image distortion code less more efficient, etc).
I'll include those remarks on the image_captcha.module
never heard about the coder module, seems interesting
Comment #2
wundo commentedthanks rob,
as soxo seems busy with other things, I'm taking this one, ok?
I will start with text captcha.
Comment #3
soxofaan commentedcaptcha_api.txt also needs some tweaks
we shouldn't give the bad example ;)
see patch
Comment #4
robloachHere's the Captcha.module Coder Review fixes.
Comment #5
robloachNo Problems Found
Comment #6
soxofaan commentedhere are some more fixes
Comment #7
robloachExcellent, thanks.
Comment #8
(not verified) commented