Fix SQL injection in array pagination filters
This commit is contained in:
@@ -510,17 +510,8 @@ trait db_object_t
|
||||
}
|
||||
$temp = [];
|
||||
foreach ( $value as $v ) {
|
||||
// Determine the type of the field
|
||||
$type = $fieldTypes[$field] ?? '';
|
||||
// If the field is an integer, cast the value to an integer
|
||||
if (!empty($type) && str_contains($type, 'int')) {
|
||||
$temp[] = "`$field` = $v";
|
||||
} else {
|
||||
$temp[] = "`$field` = ?";
|
||||
$params[] = $v;
|
||||
}
|
||||
//$temp[] = "`$field` = ?";
|
||||
//$params[] = $v;
|
||||
$temp[] = "`$field` = ?";
|
||||
$params[] = $v;
|
||||
}
|
||||
$whereClauses[] = '(' . implode(' OR ', $temp) . ')';
|
||||
continue;
|
||||
@@ -1420,4 +1411,4 @@ trait db_object_t
|
||||
$attachment = new attachments();
|
||||
return $attachment->get($attachmentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user