Commit c876f1f
committed
fix(utils): harden removeChars default char set
* Add "(", ")" and "\" to the default removed
chars, since they can break the query string
structure built around user input
* Escape each char before building the RegExp,
since "\" was previously unsafe to pass in
* Keep other ES/Lucene operators (:, +, -, *)
untouched by default
Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>1 parent 621e9bd commit c876f1f
2 files changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
0 commit comments