Skip to content

Commit

Permalink
Merge pull request DSpace#9101 from arvoConsultores/8968
Browse files Browse the repository at this point in the history
8968 - request-a-copy email: non ASCII characters are encoded as HTML…
  • Loading branch information
kshepherd authored Oct 9, 2023
2 parents 98c3c72 + d12fbe2 commit 92844f0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.validator.routines.EmailValidator;
import org.apache.http.client.utils.URIBuilder;
import org.apache.logging.log4j.LogManager;
Expand All @@ -48,7 +47,7 @@
import org.springframework.data.domain.Pageable;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;

import org.springframework.web.util.HtmlUtils;
/**
* Component to expose item requests.
*
Expand Down Expand Up @@ -173,11 +172,11 @@ public RequestItemRest createAndReturn(Context ctx)
username = user.getFullName();
} else { // An anonymous session may provide a name.
// Escape username to evade nasty XSS attempts
username = StringEscapeUtils.escapeHtml4(rir.getRequestName());
username = HtmlUtils.htmlEscape(rir.getRequestName(),"UTF-8");
}

// Requester's message text, escaped to evade nasty XSS attempts
String message = StringEscapeUtils.escapeHtml4(rir.getRequestMessage());
String message = HtmlUtils.htmlEscape(rir.getRequestMessage(),"UTF-8");

// Create the request.
String token;
Expand Down

0 comments on commit 92844f0

Please sign in to comment.