aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhe Sun <31067185+ZheSun88@users.noreply.github.com>2019-07-01 14:56:48 +0300
committerGitHub <noreply@github.com>2019-07-01 14:56:48 +0300
commit2584e9ad44fa9135daa405df8cbc9ae7d4a3ee33 (patch)
tree8b70bd2812154e89d100a4894f9630f0fcf3fa52
parent35a9c4255f1d46f4aa8e27b26ea2cd25def50ab0 (diff)
downloadvaadin-framework-2584e9ad44fa9135daa405df8cbc9ae7d4a3ee33.tar.gz
vaadin-framework-2584e9ad44fa9135daa405df8cbc9ae7d4a3ee33.zip
Sanitize caption used in Grid header (#11644)
* Sanitize input used in Grid header
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index d463832119..fa6237a83a 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -38,6 +38,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import org.jsoup.Jsoup;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
@@ -1340,6 +1341,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
*/
public Column<T, V> setCaption(String caption) {
Objects.requireNonNull(caption, "Header caption can't be null");
+ caption = Jsoup.parse(caption).text();
if (caption.equals(getState(false).caption)) {
return this;
}