Skip to content

Commit d8fd6f2

Browse files
committed
escapeTags in message field when printing status messages
Signed-off-by: ceki <ceki@qos.ch>
1 parent 95edbeb commit d8fd6f2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

logback-core/src/main/java/ch/qos/logback/core/status/ViewStatusMessagesServletBase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ private void printStatus(StringBuilder buf, Status s) {
164164
buf.append(" <td class=\"date\">").append(dateStr).append("</td>\r\n");
165165
buf.append(" <td class=\"level\">").append(statusLevelAsString(s)).append("</td>\r\n");
166166
buf.append(" <td>").append(abbreviatedOrigin(s)).append("</td>\r\n");
167-
buf.append(" <td>").append(s.getMessage()).append("</td>\r\n");
167+
String sanitizedMessage = Transform.escapeTags(s.getMessage());
168+
buf.append(" <td>").append(sanitizedMessage).append("</td>\r\n");
168169
buf.append(" </tr>\r\n");
169170
if (s.getThrowable() != null) {
170171
printThrowable(buf, s.getThrowable());

0 commit comments

Comments
 (0)