Skip to content

Commit

Permalink
this does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
tcnichol committed Apr 28, 2024
1 parent b6a4c7c commit 52a5c73
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/api/Users.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package api

import org.apache.commons.lang.StringEscapeUtils
// import org.springframework.web.util.HtmlUtils.htmlEscape
import org.apache.commons.lang.StringEscapeUtils.escapeJavaScript
import javax.inject.Inject
import play.api.libs.json._
import play.api.Play.current
Expand Down Expand Up @@ -62,7 +62,10 @@ class Users @Inject()(users: UserService, events: EventService) extends ApiContr
/** @deprecated use id instead of email */
def updateName(id: UUID, firstName: String, lastName: String) = PermissionAction(Permission.EditUser, Some(ResourceRef(ResourceRef.user, id))) { implicit request =>
implicit val user = request.user
val escapedLastName = StringEscapeUtils.escapeJavaScript(lastName)
// val escapedFirstName = htmlEscape(firstName)
// val escapedLastName = htmlEscape(lastName)
val escapedFirstName = org.apache.commons.lang.StringEscapeUtils.escapeJavaScript(firstName)
val escapedLastName = org.apache.commons.lang.StringEscapeUtils.escapeJavaScript(lastName)
users.updateUserField(id, "firstName", escapedFirstName)
users.updateUserField(id, "lastName", escapedLastName)
users.updateUserField(id, "fullName", escapedFirstName + " " + escapedLastName)
Expand Down

0 comments on commit 52a5c73

Please sign in to comment.