/** * Internal Use Only. */ private static String escapeParam(String param) { return Strings.escape(XMLs.encodeText(param), Strings.ESCAPE_JAVASCRIPT); }
/** Render the crawlable text. * If crawlable is not enabled or the text is empty, nothing is generated. * @param text the text that is crawlable. * If null or empty, nothing is generated. * @since 5.0.0 */ public static void renderCrawlableText(String text) throws IOException { if (text != null && text.length() > 0) { final HtmlPageRenders.RenderContext rc = HtmlPageRenders.getRenderContext(null); if (rc != null && rc.crawlable) { final Writer cwout = rc.temp; cwout.write("<div>"); cwout.write(XMLs.encodeText(text)); //encode required since it might not be valid HTML cwout.write("</div>\n"); } } }
public void redraw(Writer out) throws IOException { final Execution exec = Executions.getCurrent(); if (!HtmlPageRenders.isDirectContent(exec)) { super.redraw(out); return; } final boolean idRequired = isIdRequired(); if (idRequired) { out.write("<span id=\""); out.write(getUuid()); out.write("\">"); } out.write(_encode ? XMLs.encodeText(_value) : _value); if (idRequired) out.write("</span>"); final TagRenderContext rc = PageRenderer.getTagRenderContext(exec); if (rc != null) { rc.renderBegin(this, getClientEvents(), getSpecialRendererOutput(this), false); rc.renderEnd(this); } }
sid = escapeParam(request.getParameter("sid")); desktop = ((WebAppCtrl) sess.getWebApp()).getDesktopCache(sess) .getDesktop(XMLs.encodeText(request.getParameter("dtid")));
data = ("(window.zk&&zk.error?zk.error:alert)('" + XMLs.encodeText(pi) + " not found');") .getBytes("UTF-8");
} else { String msg = wapp.getConfiguration().getTimeoutMessage(deviceType); dtid = XMLs.encodeText(dtid); // Fix ZK-1862 security issue if (msg != null && msg.startsWith("label:")) { final String key;