diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-06-05 10:57:14 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-06-05 10:57:14 +0000 |
commit | c306c6f409c9171be52c3113b1352fa8ba90ed18 (patch) | |
tree | 2f78e8a6cab34c3ba10cf25334721d02ad651312 /src | |
parent | 6c096b307459fdfacf5ba867144da133ea10cda4 (diff) | |
download | vaadin-framework-c306c6f409c9171be52c3113b1352fa8ba90ed18.tar.gz vaadin-framework-c306c6f409c9171be52c3113b1352fa8ba90ed18.zip |
fixes #1767
svn changeset:4751/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/Util.java | 14 | ||||
-rw-r--r-- | src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/Util.java b/src/com/itmill/toolkit/terminal/gwt/client/Util.java index 05c915412d..20e591ff9f 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/Util.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/Util.java @@ -6,6 +6,7 @@ package com.itmill.toolkit.terminal.gwt.client; import java.util.Iterator; +import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.Widget; @@ -122,4 +123,17 @@ public class Util { } return false; }-*/; + + private static final Element escapeHtmlHelper = DOM.createDiv(); + + /** + * Converts html entities to text. + * + * @param html + * @return escaped string presentation of given html + */ + public static String escapeHTML(String html) { + DOM.setInnerText(escapeHtmlHelper, html); + return DOM.getInnerHTML(escapeHtmlHelper); + } } diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java index cbad27b9ec..6a60b0878f 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java @@ -62,7 +62,7 @@ public class IFilterSelect extends Composite implements Paintable, Field, sb.append(iconUri); sb.append("\" alt=\"icon\" class=\"i-icon\" />"); } - sb.append(caption); + sb.append(Util.escapeHTML(caption)); return sb.toString(); } |