Skip to content

Commit 342e1f6

Browse files
AngelFQCywarnier
authored andcommitted
Security: Escape array filter values in ExtraField::get_where_clause()
Refs GHSA-7whw-8467-78jp
1 parent ea2ad0b commit 342e1f6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

public/main/inc/lib/extra_field.lib.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,8 @@ public function get_where_clause($col, $oper, $val, $conditionBetweenOptions = '
29432943
}
29442944
if ('cn' === $oper || 'nc' === $oper || 'in' === $oper || 'ni' === $oper) {
29452945
if (is_array($val)) {
2946-
$result = '"%'.implode(';', $val).'%"';
2946+
$escaped = array_map(static fn ($item) => Database::escape_string(trim($item)), $val);
2947+
$result = '"%'.implode(';', $escaped).'%"';
29472948
foreach ($val as $item) {
29482949
$item = Database::escape_string(trim($item));
29492950
$result .= ' '.$conditionBetweenOptions.' '.$col.' LIKE "%'.$item.'%"';

0 commit comments

Comments
 (0)