This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push: new d2843a8 Escape body text d2843a8 is described below commit d2843a8fdb28e48b981434fbd24a78bd9cddf84a Author: remm <r...@apache.org> AuthorDate: Thu Aug 27 16:36:12 2020 +0200 Escape body text Often seen in descriptions in the web.xml and tlds. --- java/org/apache/tomcat/util/digester/CallMethodRule.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/org/apache/tomcat/util/digester/CallMethodRule.java b/java/org/apache/tomcat/util/digester/CallMethodRule.java index 0a521a9..e744a9d 100644 --- a/java/org/apache/tomcat/util/digester/CallMethodRule.java +++ b/java/org/apache/tomcat/util/digester/CallMethodRule.java @@ -393,7 +393,11 @@ public class CallMethodRule extends Rule { code.append(", "); } if (bodyText != null) { - code.append("\"").append(bodyText).append("\""); + StringBuilder bodyTextParam = new StringBuilder(); + for (String bodyPart : bodyText.split("\n")) { + bodyTextParam.append(bodyPart.trim()).append(' '); + } + code.append("\"").append(bodyTextParam.toString().trim().replace("\"", "\\\"")).append("\""); } else if (paramValues[i] instanceof String) { code.append("\"").append(paramValues[i].toString()).append("\""); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org