Skip to content

Commit

Permalink
Merge pull request #1878 from statisticsnorway/MIMIR-1721_nameSearch_…
Browse files Browse the repository at this point in the history
…and_or_search_error

update sanitize check for and & or
  • Loading branch information
KyleDanny authored May 5, 2023
2 parents 5e68e65 + 74caf09 commit 279fdde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/main/resources/services/nameSearch/nameSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ function pad(word: string): string {
}

function sanitizeQuery(name: string): string {
if (name.toLowerCase() == 'and' || 'or') {
return name.toLowerCase()
}
const approved = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ '
return whitelist(replaceCharacters(name.toUpperCase()), approved)
}
Expand Down

0 comments on commit 279fdde

Please sign in to comment.