mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-05 08:05:56 +00:00
[FIXED JENKINS-20800] HTML metacharacters not escaped in log messages.
This commit is contained in:
1 parent
8fa4ef0530
commit
a900b488b5
3 files changed
+15
-7
No files matched your search
@@ -135,7 +135,6 @@ import jenkins.model.ModelObjectWithContextMenu;
|
||||
|
||||
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
|
||||
import org.apache.commons.jelly.JellyContext;
|
||||
import org.apache.commons.jelly.JellyException;
|
||||
import org.apache.commons.jelly.JellyTagException;
|
||||
import org.apache.commons.jelly.Script;
|
||||
import org.apache.commons.jelly.XMLOutput;
|
||||
@@ -144,19 +143,15 @@ import org.apache.commons.jexl.util.Introspector;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jvnet.tiger_types.Types;
|
||||
import org.kohsuke.stapler.Ancestor;
|
||||
import org.kohsuke.stapler.MetaClass;
|
||||
import org.kohsuke.stapler.Stapler;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import org.kohsuke.stapler.StaplerResponse;
|
||||
import org.kohsuke.stapler.WebApp;
|
||||
import org.kohsuke.stapler.jelly.InternationalizedStringExpression.RawHtmlArgument;
|
||||
import org.kohsuke.stapler.jelly.JellyClassTearOff;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import org.kohsuke.accmod.Restricted;
|
||||
import org.kohsuke.accmod.restrictions.DoNotUse;
|
||||
import org.kohsuke.accmod.restrictions.NoExternalUse;
|
||||
|
||||
/**
|
||||
@@ -450,13 +445,14 @@ public class Functions {
|
||||
return formatter.format(r);
|
||||
}
|
||||
|
||||
@Restricted(DoNotUse.class)
|
||||
@Restricted(NoExternalUse.class)
|
||||
public static String[] printLogRecordHtml(LogRecord r, LogRecord prior) {
|
||||
String[] oldParts = prior == null ? new String[4] : logRecordPreformat(prior);
|
||||
String[] newParts = logRecordPreformat(r);
|
||||
for (int i = 0; i < /* not 4 */3; i++) {
|
||||
newParts[i] = "<span class='" + (newParts[i].equals(oldParts[i]) ? "logrecord-metadata-old" : "logrecord-metadata-new") + "'>" + newParts[i] + "</span>";
|
||||
}
|
||||
newParts[3] = Util.xmlEscape(newParts[3]);
|
||||
return newParts;
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user