Skip to content

Commit

Permalink
always escape RegExp when building query in mongoose connector
Browse files Browse the repository at this point in the history
Fix #10348
  • Loading branch information
vkarpov15 authored and petersg83 committed Jun 28, 2021
1 parent db34e73 commit 977cdcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/strapi-connector-mongoose/lib/buildQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ const buildWhereClause = ({ field, operator, value }) => {
case 'contains': {
return {
[field]: {
$regex: `${val}`,
$regex: _.escapeRegExp(`${val}`),
$options: 'i',
},
};
Expand All @@ -615,7 +615,7 @@ const buildWhereClause = ({ field, operator, value }) => {
case 'containss':
return {
[field]: {
$regex: `${val}`,
$regex: _.escapeRegExp(`${val}`),
},
};
case 'ncontainss':
Expand Down

0 comments on commit 977cdcf

Please sign in to comment.