Skip to content

Commit

Permalink
fix(patientrepository.ts): clean search string of illegal chars
Browse files Browse the repository at this point in the history
Added a step to remove all non-alphabetical and whitespace characters from search string regex

fix HospitalRun#1999
  • Loading branch information
JDarke committed Apr 23, 2020
1 parent add9c02 commit 57144a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clients/db/PatientRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class PatientRepository extends Repository<Patient> {
}

async search(text: string): Promise<Patient[]> {
const cleanText = text.replace(/\\/g, '')
const cleanText = text.replace(/\\[^a-zA-Z ]/g, '')
return super.search({
selector: {
$or: [
Expand Down

0 comments on commit 57144a2

Please sign in to comment.