Skip to content

Commit

Permalink
fix(patientrepository.ts): clean search string of special chars
Browse files Browse the repository at this point in the history
Removed special chars that interfered with RegExp in search strings

re HospitalRun#1999
  • Loading branch information
JDarke committed Apr 24, 2020
1 parent 57144a2 commit 0ffef66
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(/\\[^a-zA-Z ]/g, '')
const cleanText = text.replace(/[\\[()?*]+/g, '')
return super.search({
selector: {
$or: [
Expand Down

0 comments on commit 0ffef66

Please sign in to comment.