From 7f1d5bb2c016b556a53db17520eb27bce645444b Mon Sep 17 00:00:00 2001 From: Parth Kanakiya Date: Tue, 11 May 2021 08:54:00 -0700 Subject: [PATCH] Added WebUtil.escapeHTML function to ProviderListItem (#157) Solved Compatibality issues Co-authored-by: Isaac Sears --- omod/src/main/java/org/openmrs/web/dwr/ProviderListItem.java | 3 ++- .../webapp/resources/scripts/jquery-ui/js/openmrsSearch.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/omod/src/main/java/org/openmrs/web/dwr/ProviderListItem.java b/omod/src/main/java/org/openmrs/web/dwr/ProviderListItem.java index e26bc837..671fcec5 100644 --- a/omod/src/main/java/org/openmrs/web/dwr/ProviderListItem.java +++ b/omod/src/main/java/org/openmrs/web/dwr/ProviderListItem.java @@ -11,6 +11,7 @@ import org.openmrs.Person; import org.openmrs.Provider; +import org.openmrs.web.WebUtil; /** * A mini/simplified provider object. Used as the return object from DWR methods to allow javascript @@ -37,7 +38,7 @@ public ProviderListItem(Provider provider) { } else { displayName = provider.getName(); } - identifier = provider.getIdentifier(); + identifier = WebUtil.escapeHTML(provider.getIdentifier()); providerId = provider.getProviderId(); retired = provider.isRetired(); } diff --git a/omod/src/main/webapp/resources/scripts/jquery-ui/js/openmrsSearch.js b/omod/src/main/webapp/resources/scripts/jquery-ui/js/openmrsSearch.js index 12ba9b50..56fb3b74 100644 --- a/omod/src/main/webapp/resources/scripts/jquery-ui/js/openmrsSearch.js +++ b/omod/src/main/webapp/resources/scripts/jquery-ui/js/openmrsSearch.js @@ -841,6 +841,7 @@ function OpenmrsSearch(div, showIncludeVoided, searchHandler, selectionHandler, var data = rowData[c.fieldName]; if(data == null) data = " "; + return data; });