This commit is contained in:
sirjonasxx 2021-08-20 21:49:00 +02:00
parent 87ef847796
commit c26a9149f5
2 changed files with 8 additions and 3 deletions

View File

@ -187,11 +187,11 @@ public class GExtensionStoreController implements Initializable {
webView.getEngine().executeScript(String.format("setHeading(\"%s\", \"%s\", \"%s\")", webView.getEngine().executeScript(String.format("setHeading(\"%s\", \"%s\", \"%s\")",
WebUtils.escapeHtmlNoBackslash(overview.header().iconUrl()), WebUtils.escapeHtmlNoBackslash(overview.header().iconUrl()),
WebUtils.escapeMessage(overview.header().title()), WebUtils.escapeMessageAndQuotes(overview.header().title()),
WebUtils.escapeMessage(overview.header().description()) WebUtils.escapeMessageAndQuotes(overview.header().description())
)); ));
webView.getEngine().executeScript(String.format("setContentTitle(\"%s\")", webView.getEngine().executeScript(String.format("setContentTitle(\"%s\")",
WebUtils.escapeMessage(overview.header().contentTitle()) WebUtils.escapeMessageAndQuotes(overview.header().contentTitle())
)); ));
}); });
} }

View File

@ -66,6 +66,11 @@ public class WebUtils {
.replace("\r", "<br>"); .replace("\r", "<br>");
} }
public static String escapeMessageAndQuotes(String text) {
text = escapeMessage(text);
return text.replace("\"", "&quot;");
}
public static void clearElement(Element node) { public static void clearElement(Element node) {
while (node.hasChildNodes()) while (node.hasChildNodes())
node.removeChild(node.getFirstChild()); node.removeChild(node.getFirstChild());