Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2011 at 10:29 UTC
Updated:
6 Jan 2012 at 18:38 UTC
Contests module adds a new content type that let you create a contest.
You can choose to add options or let the user answer with a freetext or have both.
Extrafield is a custom field that lets you add another question like Homeaddress or what every you want.
The checkbox field is for something like "Do you want to get newsletter from us?".
Javascript validation is implemented but can be turned off in settings.
Comments
Comment #1
berdirPlease include the link to your sandbox project page and set this to needs review.
Comment #2
kevinn commentedhttp://drupal.org/sandbox/kevinn/1125812
Comment #3
ralt commentedHello,
Here is a quick review :
I haven't checked your .js file.
You should get your module through the Coder module, it will help you to find trailing whitespaces, and fix your indents problems.
But mostly, you MUST fix your SQL injections and XSS attacks risks. Absolutely.
Otherwise, the module looks good, just talking about feature :).
Have a nice day!
Comment #4
ralt commentedComment #5
berdir@Ralt
There is no such hook, that is just a form builder function.
- #default_value is already checked by FAPI. However, not sure why it's necessary at all to define the get values as default value, though.
- As long as placeholders are used, there is no need for additional sanitation of $_GET values. XSS protection should happen when something is displayed, not when it is stored.
Comment #6
ralt commentedHello,
@Berdir : my bad! I guess I still need to learn, heh.
Then, the module just needs to get past the coder module to remove trailing whitespaces and fix indents problems, and it will be then good to go, I think.
Comment #7
kevinn commentedI have run the module with coder and there was no errors or warning.
Comment #8
kevinn commentedChanged the indent from 4 spaces to 2.
Comment #9
kevinn commentedAdded check_plain().
Comment #10
kevinn commentedComment #11
kevinn commentedSo what do you guys think about the module now? Is it ready?
Comment #12
rteijeiro commentedHi.
I have noticed that you didn't changed the readme.txt file name to README.txt
Also you should change the SQL Insert and Update statements (contest_insert and contest_update functions) by the drupal_write_record function: http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_wr...
Kind regards.
Comment #13
kevinn commentedFixed.
Comment #14
rteijeiro commentedHi.
I'm getting this errors testing the Contest module:
warning: Missing argument 2 for variable_get() in contests.module on line 267
warning: Missing argument 2 for variable_get() in contests.admin.inc on line 36
Also I am trying to "Compete" a question but it doesn't work for me.
Please, be sure all the files ends with a blank new line.
Kind regards.
Comment #15
kevinn commentedThanks, fixed.
Comment #16
Jonathan Peterson commented(Jumping in on what looks like an abandonded review process.)
In my opinion this project is ready to go. The submitter has made all the requested changes, and has met all of the requirements for inclusion. I've reviewed the code and in my opinion it's very good; higher quality and better documented than many other modules I've seen. Plus, it works -- it does what it says it does, and it's simple.
My only concern is that you could build something very similar to this using the webform module, so there's some duplicated functionality here. However, it's been two months since the submitter first posted this, so it seems to me it'd be quite unfair to come back and demand a justification for it at this stage. It's simpler and lighter weight than webform.
I say he's done. Changing status to reviewed and tested.
Comment #17
rfayIt looks to me like there are critical security issues here. You're doing a direct query of the node table, not doing a db_rewrite_sql() on it in case there are node access constraints, not checking to see if a node is disabled. And you're displaying the user-entered title without sanitizing it.
In contests_compete_form_submit() I see
without any definition of $object. Is nobody running with errors being output? One of my favorite rants: http://randyfay.com/node/76
You don't put the version in the .info file. The packaging system puts that there.
It looks to me like all reviewers should have a look at http://drupal.org/writing-secure-code, since security issues are the most important reason for this whole process. And here we have a raw query of the node table and raw output of the results, without respecting permissions, node access, or anything else. Ooops.
Comment #18
Jonathan Peterson commentedOops indeed. Mea culpa.
Comment #19
klausiNo activity in several months. Reopen and set the status to "needs review" if you are still pursuing this application.