Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=43617
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 23 Apr 2008 21:52:11 +0000 (21:52 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 23 Apr 2008 21:52:11 +0000 (21:52 +0000)
Correctly handle quotes in attribute values for tag(x) files.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@651082 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/compiler/Generator.java

index 4f0a4f8..183a399 100644 (file)
@@ -1755,6 +1755,7 @@ class Generator {
                 String value = attrs.getValue(i);
                 if (value.indexOf('"') != -1) {
                     quote = SINGLE_QUOTE;
+                    value = value.replace("\"", DOUBLE_QUOTE);
                 }
                 out.print(quote);
                 out.print(value);
@@ -1777,6 +1778,7 @@ class Generator {
                     String value = attrs.getValue(i);
                     if (value.indexOf('"') != -1) {
                         quote = SINGLE_QUOTE;
+                        value = value.replace("\"", DOUBLE_QUOTE);
                     }
                     out.print(quote);
                     out.print(value);