diff --git a/src/fitnesse/resources/templates/searchResults.vm b/src/fitnesse/resources/templates/searchResults.vm index 7df9dbfb4..e49a83645 100644 --- a/src/fitnesse/resources/templates/searchResults.vm +++ b/src/fitnesse/resources/templates/searchResults.vm @@ -35,7 +35,7 @@ #set ( $tags = $result.getData().getAttribute("Suites") ) - + $result.getData().getProperties().getLastModificationTime() @@ -65,4 +65,4 @@ #else -#end \ No newline at end of file +#end diff --git a/test/fitnesse/responders/search/SearchResponderTest.java b/test/fitnesse/responders/search/SearchResponderTest.java index bcab52a76..6b6b76640 100644 --- a/test/fitnesse/responders/search/SearchResponderTest.java +++ b/test/fitnesse/responders/search/SearchResponderTest.java @@ -8,9 +8,7 @@ import fitnesse.http.Request; import fitnesse.http.Response; import fitnesse.testutil.FitNesseUtil; -import fitnesse.wiki.PathParser; -import fitnesse.wiki.WikiPage; -import fitnesse.wiki.WikiPageUtil; +import fitnesse.wiki.*; import org.junit.Before; import org.junit.Test; @@ -27,6 +25,7 @@ public class SearchResponderTest { public void setUp() throws Exception { context = FitNesseUtil.makeTestContext(); WikiPage somePage = WikiPageUtil.addPage(context.getRootPage(), PathParser.parse("SomePage"), "has something in it"); + WikiPageUtil.addPage(somePage, PathParser.parse("SomeTest"), "test page content"); WikiPageUtil.addPage(somePage, PathParser.parse("SomeSuite"), "suite page content"); request = new MockRequest(); @@ -218,4 +217,14 @@ public void suiteLinkShouldContainFullPagePath() throws Exception { assertSubString("Suite", searchPageContent); } + @Test + public void tagsShouldBeEscaped() throws Exception { + WikiPage somePage = context.getRootPage().getChildPage("SomePage"); + PageData data = somePage.getData(); + data.setAttribute(WikiPageProperty.SUITES, " "); + somePage.commit(data); + String searchPageContent = getResponseContentUsingSearchString("something"); + + assertSubString("<script>TEST</script>", searchPageContent); + } }