public MenuItem withDisplayName(String displayName) { this.displayName = Util.escape(displayName); return this; }
public static String escape(String s) { return Util.escape(s); }
@Override public void translate(String markup, Writer output) throws IOException { output.write(Util.escape(markup)); }
/** * Message escaped for HTML */ public String getMsgEscaped() { return Util.escape(getMsg()); }
/** * Sends out a string error message that indicates an error. * * @param message * Human readable message to be sent. {@code error(null)} * can be used as {@code ok()}. */ public void error(String message) throws IOException, ServletException { errorWithMarkup(message==null?null:Util.escape(message)); }
/** * Sends out a string error message that indicates an error. * * @param message * Human readable message to be sent. {@code error(null)} * can be used as {@code ok()}. */ public static FormValidation error(String message) { return errorWithMarkup(message==null?null: Util.escape(message)); }
/** * Sends out a string error message that indicates an error. * * @param message Human readable message to be sent. */ public static FormFillFailure error(@Nonnull String message) { return errorWithMarkup(Util.escape(message)); }
public void warning(String message) throws IOException, ServletException { warningWithMarkup(message==null?null:Util.escape(message)); }
public static FormValidation ok(String message) { return okWithMarkup(message==null?null:Util.escape(message)); }
public static FormFillFailure warning(@Nonnull String message) { return warningWithMarkup(Util.escape(message)); }
public void ok(String message) throws IOException, ServletException { okWithMarkup(message==null?null:Util.escape(message)); }
public static FormValidation warning(String message) { return warningWithMarkup(message==null?null:Util.escape(message)); }
private static FormValidation _error(Kind kind, Throwable e, String message) { if (e==null) return _errorWithMarkup(Util.escape(message),kind); return _errorWithMarkup(Util.escape(message)+ " <a href='#' class='showDetails'>" + Messages.FormValidation_Error_Details() + "</a><pre style='display:none'>" + Util.escape(Functions.printThrowable(e)) + "</pre>",kind ); }
private static FormFillFailure _error(FormValidation.Kind kind, Throwable e, String message) { if (e == null) { return _errorWithMarkup(Util.escape(message), kind); } return _errorWithMarkup(Util.escape(message) + " <a href='#' class='showDetails'>" + Messages.FormValidation_Error_Details() + "</a><pre style='display:none'>" + Util.escape(Functions.printThrowable(e)) + "</pre>", kind ); }
/** * Returns the fully marked-up text. * * @param preEscape * If true, the escaping is for the {@code <PRE>} context. This leave SP and CR/LF intact. * If false, the escape is for the normal HTML, thus SP becomes &nbsp; and CR/LF becomes {@code <BR>} */ public String toString(boolean preEscape) { if(tags.isEmpty()) return preEscape? Util.xmlEscape(text) : Util.escape(text); // the most common case Collections.sort(tags); StringBuilder buf = new StringBuilder(); int copied = 0; // # of chars already copied from text to buf for (Tag tag : tags) { if (copied<tag.pos) { String portion = text.substring(copied, tag.pos); buf.append(preEscape ? Util.xmlEscape(portion) : Util.escape(portion)); copied = tag.pos; } buf.append(tag.markup); } if (copied<text.length()) { String portion = text.substring(copied, text.length()); buf.append(preEscape ? Util.xmlEscape(portion) : Util.escape(portion)); } return buf.toString(); }
public TimelineEventList doData(StaplerRequest req, @QueryParameter long min, @QueryParameter long max) throws IOException { TimelineEventList result = new TimelineEventList(); for (Run r : builds.byTimestamp(min,max)) { Event e = new Event(); e.start = new Date(r.getStartTimeInMillis()); e.end = new Date(r.getStartTimeInMillis()+r.getDuration()); // due to SimileAjax.HTML.deEntify (in simile-ajax-bundle.js), "<" are transformed back to "<", but not the "<"; // to protect against XSS e.title = Util.escape(r.getFullDisplayName()).replace("<", "<"); // what to put in the description? // e.description = "Longish description of event "+r.getFullDisplayName(); // e.durationEvent = true; e.link = req.getContextPath()+'/'+r.getUrl(); BallColor c = r.getIconColor(); e.color = String.format("#%06X",c.getBaseColor().darker().getRGB()&0xFFFFFF); e.classname = "event-"+c.noAnime().toString()+" " + (c.isAnimated()?"animated":""); result.add(e); } return result; }
j.getRootUrl(), Util.escape(l.getName()), l.getUrl(), l.getNodes().size(), l.getClouds().size()) );
/** * Sends out a string error message that indicates an error. * * @param message * Human readable message to be sent. <tt>error(null)</tt> * can be used as <tt>ok()</tt>. */ public static FormValidation error(String message) { return errorWithMarkup(message==null?null: Util.escape(message)); }
/** * Message escaped for HTML */ public String getMsgEscaped() { return Util.escape(getMsg()); }
private static FormValidation _error(Kind kind, Throwable e, String message) { if (e==null) return _errorWithMarkup(Util.escape(message),kind); return _errorWithMarkup(Util.escape(message)+ " <a href='#' class='showDetails'>" + Messages.FormValidation_Error_Details() + "</a><pre style='display:none'>" + Util.escape(Functions.printThrowable(e)) + "</pre>",kind ); }