mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +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
@@ -37,6 +37,8 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
import jenkins.model.Jenkins;
|
||||
|
||||
@@ -293,4 +295,12 @@ public class FunctionsTest {
|
||||
assertEquals("H<wbr>,e<wbr>.l<wbr>/l<wbr>:o<wbr>-w<wbr>_o<wbr>=+|d", Functions.breakableString("H,e.l/l:o-w_o=+|d"));
|
||||
assertEquals("ALongStrin<wbr>gThatCanNo<wbr>tBeBrokenB<wbr>yDefault", Functions.breakableString("ALongStringThatCanNotBeBrokenByDefault"));
|
||||
}
|
||||
|
||||
@Bug(20800)
|
||||
@Test public void printLogRecordHtml() throws Exception {
|
||||
LogRecord lr = new LogRecord(Level.INFO, "Bad input <xml/>");
|
||||
lr.setLoggerName("test");
|
||||
assertEquals("Bad input <xml/>\n", Functions.printLogRecordHtml(lr, null)[3]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user