Skip to content

Commit

Permalink
8968 - implementated using HtmlUtils scaping
Browse files Browse the repository at this point in the history
  • Loading branch information
aroman-arvo committed Oct 9, 2023
1 parent 2c2b3b1 commit 090beed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 54 deletions.
50 changes: 0 additions & 50 deletions dspace-api/src/main/java/org/dspace/util/StringEscapeUtils.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
import org.dspace.core.Context;
import org.dspace.eperson.EPerson;
import org.dspace.services.ConfigurationService;
import org.dspace.util.StringEscapeUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
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 +173,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.escapeMail(rir.getRequestName());
username = HtmlUtils.htmlEscape(rir.getRequestName(),"UTF-8");
}

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

// Create the request.
String token;
Expand Down

0 comments on commit 090beed

Please sign in to comment.