diff --git a/app/controllers/Spaces.scala b/app/controllers/Spaces.scala index 1c197060a..9cb2fd4b8 100644 --- a/app/controllers/Spaces.scala +++ b/app/controllers/Spaces.scala @@ -7,6 +7,7 @@ import org.joda.time.DateTime import play.api.data.Forms._ import play.api.data.{Form, Forms} import play.api.i18n.Messages +import play.api.templates.HtmlFormat import play.api.{Logger, Play} import securesocial.core.providers.{Token, UsernamePasswordProvider} import services._ @@ -411,7 +412,7 @@ class Spaces @Inject() (spaces: SpaceService, users: UserService, events: EventS formData => { if (Permission.checkPermission(user, Permission.CreateSpace)) { Logger.debug("Creating space " + formData.name) - val newSpace = ProjectSpace(name = formData.name, description = formData.description, + val newSpace = ProjectSpace(name = HtmlFormat.escape(formData.name).toString(), description = HtmlFormat.escape(formData.description).toString(), created = new Date, creator = userId, homePage = formData.homePage, logoURL = formData.logoURL, bannerURL = formData.bannerURL, collectionCount = 0, datasetCount = 0, fileCount = 0, userCount = 0, spaceBytes = 0, metadata = List.empty, diff --git a/app/views/spaces/listItem.scala.html b/app/views/spaces/listItem.scala.html index fd96c1a53..474fe6fb2 100644 --- a/app/views/spaces/listItem.scala.html +++ b/app/views/spaces/listItem.scala.html @@ -22,7 +22,7 @@

@space.name

-
@Html(space.description.replace("\n","
"))
+
space.description.replace("\n","
")
@space.created.format("MMM dd, yyyy")
@space.datasetCount diff --git a/app/views/spaces/newEditTemplate.scala.html b/app/views/spaces/newEditTemplate.scala.html index 26b4e3507..4bc8cf88d 100644 --- a/app/views/spaces/newEditTemplate.scala.html +++ b/app/views/spaces/newEditTemplate.scala.html @@ -13,7 +13,7 @@
-

@Html(space.description.replace("\n","
"))

+

@space.description.replace("\n","
")

@if(user.isDefined) {
diff --git a/app/views/spaces/tile.scala.html b/app/views/spaces/tile.scala.html index 896c60c58..8b2fd8195 100644 --- a/app/views/spaces/tile.scala.html +++ b/app/views/spaces/tile.scala.html @@ -13,7 +13,7 @@ }

@space.name

-

@Html(space.description.replace("\n","
"))

+

@space.description.replace("\n","
")