Closed (outdated)
Project:
Blog Add-ons
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
27 Jul 2008 at 13:46 UTC
Updated:
24 Sep 2020 at 20:13 UTC
Jump to comment: Most recent
Like the Drupal documentation suggests, any SQL query should not pass the parameters directly in the query, but it should use placeholders.
In example, a query like:
db_query("SELECT * from {table} WHERE field = ". $number);
should be rewritten in:
db_query("SELECT * from {table} WHERE field = %d", $number);
This would also prevent any XSS attack.
Comments
Comment #1
avpadernoComment #2
Chajecki commentedThanks. Very good general comment and I will fix the problem. However if you read the code you will realize that there was no risks of attacks in those cases.
Again, will be fix in new release that will come in a few day.
Comment #3
avpadernoThere would not be any risk of attacks with the actual code, as the value used doesn't come from any user's input.
I think it's generally better to use placeholders, just to prevent problems when the code is changed.
The "issue" is very minimal, and doesn't even require a normal priority; I am sorry I didn't set the right priority (I keep to forget there is the possibility to change it).
Comment #4
avpadernoI am closing this issue since it's for a Drupal version that isn't supported.