Skip to content

Commit

Permalink
Sanitize caption used in Grid header
Browse files Browse the repository at this point in the history
Cherry pick of #11644
  • Loading branch information
TatuLund authored and ZheSun88 committed Jul 2, 2019
1 parent a723b85 commit ca3af82
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/main/java/com/vaadin/ui/Grid.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
Expand Down Expand Up @@ -3424,6 +3425,7 @@ public Column setHeaderCaption(String caption)
if (caption == null) {
caption = ""; // Render null as empty
}
caption = Jsoup.parse(caption).text();
state.headerCaption = caption;

HeaderRow row = grid.getHeader().getDefaultRow();
Expand Down

0 comments on commit ca3af82

Please sign in to comment.