/** * Escape plaintext for display inside a plain textarea. * @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead */ public static String escapeHtmlTextarea(String value) { return FormattedText.escapeHtml(value, false); }
@Override public String htmlSpecialChars(String str) { return FormattedText.escapeHtml(str, false); }
/** * Escape a plaintext string so that it can be output as part of an HTML document. Amperstand, greater-than, less-than, newlines, etc, will be escaped so that they display (instead of being interpreted as formatting). * * @param value * The string to escape. * @return value fully escaped for HTML. * @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead */ public static String escapeHtml(String value) { return FormattedText.escapeHtml(value, true); }
/** * Escape a plaintext string so that it can be output as part of an HTML document. Amperstand, greater-than, less-than, newlines, etc, will be escaped so that they display (instead of being interpreted as formatting). * * @param value * The string to escape. * @return value fully escaped for HTML. * @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead */ public static String escapeHtml(String value) { return FormattedText.escapeHtml(value, true); }
@Override public String htmlSpecialChars(String str) { return FormattedText.escapeHtml(str, false); }
/** * Escape the given value so that it appears as-is in HTML - that is, HTML meta-characters like '<' are escaped to HTML character entity references like '<'. Markup, amper, quote are escaped. Whitespace is not. * * @param value * The string to escape. * @param escapeNewlines * Whether to escape newlines as "<br />\n" so that they appear as HTML line breaks. * @return value fully escaped for HTML. * @deprecated this is a passthrough for {@link FormattedText#escapeHtml(String, boolean)} so use that instead */ public static String escapeHtml(String value, boolean escapeNewlines) { return FormattedText.escapeHtml(value, escapeNewlines); }
@Override public String htmlSpecialChars(String str) { return FormattedText.escapeHtml(str, false); }
/** * @param formattedText The formatted text to convert to plain text and then to trim * @param maxNumOfChars The maximum number of characters for the trimmed text. * @return Ellipse A String to represent the ending pattern of the trimmed text */ public String doPlainTextAndLimit(String formattedText, int maxNumOfChars, String ellipse) { formattedText = StringUtils.trimToNull(formattedText); if(formattedText == null || formattedText.equalsIgnoreCase("<br/>") || formattedText.equalsIgnoreCase("<br>")|| formattedText.equals(" ") || FormattedText.escapeHtml(formattedText,false).equals("<br type="_moz" />")){ return ""; } StringBuilder sb = new StringBuilder(); String text = FormattedText.convertFormattedTextToPlaintext(formattedText); if(maxNumOfChars>text.length()){ maxNumOfChars=text.length(); } String trimmedText=text.substring(0, maxNumOfChars); sb.setLength(0); sb.append(trimmedText).append(ellipse); return Validator.escapeHtml(sb.toString()); } }
out.println(FormattedText.escapeHtml(problem, false)); out.println("\">"); out.println(FormattedText.escapeHtml(requestDisplay, false)); out.println("\">"); out.println("<input type=\"hidden\" name=\"problemPlacement\" value=\""); out.println(FormattedText.escapeHtml(placementDisplay, false)); out.println("\">"); out.println("<input type=\"hidden\" name=\"problemdigest\" value=\"" + FormattedText.escapeHtml(problemdigest, false) + "\">"); out.println("<input type=\"hidden\" name=\"session\" value=\"" + FormattedText.escapeHtml(usageSessionId, false) + "\">"); out.println("<input type=\"hidden\" name=\"bugid\" value=\"" + FormattedText.escapeHtml(bugId, false) + "\">"); out.println("<input type=\"hidden\" name=\"user\" value=\"" + FormattedText.escapeHtml(userId, false) + "\">"); out.println("<input type=\"hidden\" name=\"time\" value=\"" + FormattedText.escapeHtml(time, false) + "\">"); out.println(FormattedText.escapeHtml(problem, false)); out.println(); out.println(rb.getString("bugreport.user") + ": " + FormattedText.escapeHtml(userId, false) + "\n"); out.println(rb.getString("bugreport.usagesession") + ": " + FormattedText.escapeHtml(usageSessionId, false) + "\n"); out.println(rb.getString("bugreport.time") + ": " + FormattedText.escapeHtml(time, false) + "\n"); out.println("</pre></p>");
bufferedException.printStackTrace(printWriter); String storedContent = "<div class=\"portlettraceback\">\n" + FormattedText.escapeHtml(result.toString(),true) + "\n</pre>\n"; return storedContent;
if ( siteId != null ) splash = FormattedText.escapeHtml(splash,false); doSplash(req, res, splash, rb); return; if ( splash != null ) splash = FormattedText.escapeHtml(splash,false);