2323import javax .persistence .EntityManager ;
2424import javax .persistence .PersistenceContext ;
2525import javax .persistence .TypedQuery ;
26- import org .apache .commons .lang .StringEscapeUtils ;
26+ import org .apache .commons .text .StringEscapeUtils ;
2727import org .jsoup .Jsoup ;
2828import org .jsoup .nodes .Document ;
2929import org .jsoup .nodes .Element ;
@@ -175,7 +175,7 @@ public static String getMetadataFromDvObject(String identifier, Map<String, Stri
175175 metadataTemplate .setAuthors (dataset .getLatestVersion ().getDatasetAuthors ());
176176 if (dvObject .isInstanceofDataset ()) {
177177 //While getDescriptionPlainText strips < and > from HTML, it leaves '&' (at least so we need to xml escape as well
178- String description = StringEscapeUtils .escapeXml (dataset .getLatestVersion ().getDescriptionPlainText ());
178+ String description = StringEscapeUtils .escapeXml10 (dataset .getLatestVersion ().getDescriptionPlainText ());
179179 if (description .isEmpty () || description .equals (DatasetField .NA_VALUE )) {
180180 description = AbstractGlobalIdServiceBean .UNAVAILABLE ;
181181 }
@@ -185,7 +185,7 @@ public static String getMetadataFromDvObject(String identifier, Map<String, Stri
185185 DataFile df = (DataFile ) dvObject ;
186186 //Note: File metadata is not escaped like dataset metadata is, so adding an xml escape here.
187187 //This could/should be removed if the datafile methods add escaping
188- String fileDescription = StringEscapeUtils .escapeXml (df .getDescription ());
188+ String fileDescription = StringEscapeUtils .escapeXml10 (df .getDescription ());
189189 metadataTemplate .setDescription (fileDescription == null ? AbstractGlobalIdServiceBean .UNAVAILABLE : fileDescription );
190190 String datasetPid = df .getOwner ().getGlobalId ().asString ();
191191 metadataTemplate .setDatasetIdentifier (datasetPid );
@@ -198,7 +198,7 @@ public static String getMetadataFromDvObject(String identifier, Map<String, Stri
198198 String title = dvObject .getCurrentName ();
199199 if (dvObject .isInstanceofDataFile ()) {
200200 //Note file title is not currently escaped the way the dataset title is, so adding it here.
201- title = StringEscapeUtils .escapeXml (title );
201+ title = StringEscapeUtils .escapeXml10 (title );
202202 }
203203
204204 if (title .isEmpty () || title .equals (DatasetField .NA_VALUE )) {
0 commit comments