Skip to content

Commit

Permalink
Merge pull request #642 from distributive/main
Browse files Browse the repository at this point in the history
Fixed deckbuilding search - queries are no longer parsed as regexes
  • Loading branch information
plural authored Jun 8, 2022
2 parents 8ea1477 + 9c36a82 commit 1c9e27a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/js/nrdb.smart_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
var condition = conditions[i];
var type = condition.shift();
var operator = condition.shift();
var values = condition;
var values = condition.map(v => {
return v.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // Escape regex special characters
});

/* NOTE: some parameters are missing (e.g. faction, cycle number) because
* they interact weird with the UI. */
Expand Down Expand Up @@ -121,7 +123,7 @@
case "!":
SmartFilterQuery[key] = {
'$nee': null,
'$eq' : new RegExp(values, 'i')
'$nin' : values
};
break;
}
Expand Down

0 comments on commit 1c9e27a

Please sign in to comment.