Skip to content

Commit e8332fd

Browse files
committed
Add Database::escape_string in query #security
1 parent 7fbace9 commit e8332fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/inc/lib/extra_field.lib.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3117,6 +3117,7 @@ public function searchOptionsFromTags($from, $search, $options)
31173117
$tagRelExtraTable = Database::get_main_table(TABLE_MAIN_EXTRA_FIELD_REL_TAG);
31183118
$tagTable = Database::get_main_table(TABLE_MAIN_TAG);
31193119
$optionsTable = Database::get_main_table(TABLE_EXTRA_FIELD_OPTIONS);
3120+
$value = Database::escape_string(implode("','", $options));
31203121

31213122
$sql = "SELECT DISTINCT t.*, v.value, o.display_text
31223123
FROM $tagRelExtraTable te
@@ -3126,7 +3127,7 @@ public function searchOptionsFromTags($from, $search, $options)
31263127
ON (te.item_id = v.item_id AND v.field_id = $id)
31273128
INNER JOIN $optionsTable o
31283129
ON (o.option_value = v.value)
3129-
WHERE v.value IN ('".implode("','", $options)."')
3130+
WHERE v.value IN ('".$value."')
31303131
ORDER BY o.option_order, t.tag
31313132
";
31323133

0 commit comments

Comments
 (0)