Skip to content

Commit

Permalink
Sanitize all occurencies
Browse files Browse the repository at this point in the history
  • Loading branch information
steunix committed Oct 14, 2024
1 parent 015278f commit 41c2d84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/v1/controllers/items.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ export async function list (req, res, next) {
// Split search string and create array for ':*' addition in ts_query
const contains = []
if (search !== '') {
let sanitize = search.replace(':', ' ')
sanitize = sanitize.replace('&', ' ')
sanitize = sanitize.replace('*', ' ')
sanitize = sanitize.replace('|', ' ')
let sanitize = search.replaceAll(':', ' ')
sanitize = sanitize.replaceAll('&', ' ')
sanitize = sanitize.replaceAll('*', ' ')
sanitize = sanitize.replaceAll('|', ' ')

const searchTokens = sanitize.trim().split(' ')
for (const token of searchTokens) {
Expand Down

0 comments on commit 41c2d84

Please sign in to comment.