

Line 2791: In SQL strings, Use
db_query() placeholders in place of variables. This is a protential source of SQL injection attacks when the variable can come from user data. (
Drupal Docs)
$sql = "SELECT COUNT(*) FROM {node_access} WHERE (nid = 0 OR nid = %d) $grants_sql AND grant_$op >= 1";Explanation: Use %s and %d variable substitution. When inserting an array of values use $placeholders = implode(',', array_fill(0, count($args), "'%s'"));