瀏覽代碼

Fix sanitization of empty RTA input for Firefox & IE (#11937)

Browsers differ in what they return as the content of a visually empty rich text area (RTA). Accordingly, RTA sanitizes these different values ensuring an empty string is returned to the framework. However, existing sanitization criteria doesn't work for Firefox 74 and Internet Explorer 11.

This fix appends the sanitization criteria of Firefox 74 and IE 11, ensuring an empty string is returned to the framework for a a visually empty RTA.

Closes #10338
tags/8.11.0.alpha1
Tarek Oraby 4 年之前
父節點
當前提交
a281d73fc2
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      client/src/main/java/com/vaadin/client/ui/VRichTextArea.java

+ 2
- 2
client/src/main/java/com/vaadin/client/ui/VRichTextArea.java 查看文件

@@ -365,7 +365,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler,
BrowserInfo browser = BrowserInfo.get();
String result = getValue();
if (browser.isFirefox()) {
if ("<br>".equals(result)) {
if ("<br>".equals(result) || "<div><br></div>".equals(result)) {
result = "";
}
} else if (browser.isWebkit() || browser.isEdge()) {
@@ -373,7 +373,7 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler,
result = "";
}
} else if (browser.isIE()) {
if ("<P>&nbsp;</P>".equals(result)) {
if ("<P>&nbsp;</P>".equals(result) || "<p><br></p>".equals(result)) {
result = "";
}
} else if (browser.isOpera()) {

Loading…
取消
儲存