You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2011/12/27 08:46:29 UTC

svn commit: r1224877 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/jasper/compiler/Parser.java webapps/docs/changelog.xml

Author: kkolinko
Date: Tue Dec 27 07:46:29 2011
New Revision: 1224877

URL: http://svn.apache.org/viewvc?rev=1224877&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52335
Only handle <\% and not \% as escaped in template text.

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Parser.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1224877&r1=1224876&r2=1224877&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Dec 27 07:46:29 2011
@@ -87,12 +87,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: kkolinko,funkman
   -1:
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52335
-  Only handle <\% and not \% as escaped in template text.
-  http://svn.apache.org/viewvc?rev=1215121&view=rev
-  +1: markt,funkman, kkolinko
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52293
   Correctly handle antiResourceLocking=true when unpackWARs=false
   Correctly handle multi-level contexts when antiResourceLocking=true

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Parser.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Parser.java?rev=1224877&r1=1224876&r2=1224877&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Parser.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Parser.java Tue Dec 27 07:46:29 2011
@@ -1250,7 +1250,7 @@ class Parser implements TagConstants {
 
     /*
      * Parse for a template text string until '<' or "${" or "#{" is encountered,
-     * recognizing escape sequences "\%", "\$", and "\#".
+     * recognizing escape sequences "<\%", "\$", and "\#".
      */
     private void parseTemplateText(Node parent) throws JasperException {
 
@@ -1267,6 +1267,7 @@ class Parser implements TagConstants {
         }
 
         while (reader.hasMoreInput()) {
+            int prev = ch;
             ch = reader.nextChar();
             if (ch == '<') {
                 reader.pushChar();
@@ -1291,8 +1292,9 @@ class Parser implements TagConstants {
                 }
                 char next = (char) reader.peekChar();
                 // Looking for \% or \$ or \#
-                if (next == '%' || ((next == '$' || next == '#') &&
-                        !pageInfo.isELIgnored())) {
+                if ((prev == '<' && next == '%') ||
+                        ((next == '$' || next == '#') &&
+                                !pageInfo.isELIgnored())) {
                     ch = reader.nextChar();
                 }
             }

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1224877&r1=1224876&r2=1224877&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Tue Dec 27 07:46:29 2011
@@ -70,6 +70,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Jasper">
+    <changelog>
+      <fix>
+        <bug>52335</bug>: Only handle <code>&lt;\%</code> and not
+        <code>\%</code> as escaped in template text. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Webapps">
     <changelog>
       <fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org