Prevent SQL injection by skipping escaping for numeric values in db_object_t filter clause
This commit is contained in:
@@ -111,6 +111,10 @@ trait db_object_t
|
||||
$in = implode(',', array_map(function ($v) {
|
||||
// Escape the value to prevent SQL injection
|
||||
global $db;
|
||||
// If the value is numeric, return it as is
|
||||
if (is_numeric($v)) {
|
||||
return $v;
|
||||
}
|
||||
return "'" . $db->escape_string($v) . "'";
|
||||
}, $value));
|
||||
$where[] = "$field IN ($in)";
|
||||
|
||||
Reference in New Issue
Block a user