Hey Ki,

I ran the coder module and came across the following critical SQL issues:

report_content.module:
Line 87, Line 90, and Line 137: the %s placeholder needs to be wrapped in single quotes to avoid SQL injection.

report_user.module:
Line 104 and Line 116: need curly brackets around the table names.
Line 420: use placeholders instead of variables in a query.

I also found some normal status SQL issues:

report.module
Line 101: Use db_query_range() instead of the SQL LIMIT clause

report_content.module
Line 87, Line 90, Line 137: Use db_query_range() instead of the SQL LIMIT clause

There were also a series of other Drupal coding issues that I came across. I've attached a patch with fixes for all of these issues.

-German

CommentFileSizeAuthor
#1 report-[843234].patch94.4 KBgclicon

Comments

gclicon’s picture

StatusFileSize
new94.4 KB

Whoops!

forgot to attach the patch file.

Here you go.

ki’s picture

Assigned: Unassigned » ki
Status: Active » Fixed

Thanks for the clean up work, German.

Some of the suggestions were modified because putting quotes around %s would break the code in this case.

Ki

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.