tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r424634 - in /tomcat/container/tc5.5.x: catalina/src/share/org/apache/catalina/ssi/SSIProcessor.java webapps/docs/changelog.xml
Date Sat, 22 Jul 2006 21:48:39 GMT
Author: markt
Date: Sat Jul 22 14:48:38 2006
New Revision: 424634

URL: http://svn.apache.org/viewvc?rev=424634&view=rev
Log:
Fix bug 39689. Allow same quoting for SSI attribute values as httpd.

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/ssi/SSIProcessor.java
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/ssi/SSIProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/ssi/SSIProcessor.java?rev=424634&r1=424633&r2=424634&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/ssi/SSIProcessor.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/ssi/SSIProcessor.java
Sat Jul 22 14:48:38 2006
@@ -232,12 +232,14 @@
         boolean inside = false;
         String[] vals = new String[count];
         StringBuffer sb = new StringBuffer();
+        char endQuote = 0;
         for (int bIdx = start; bIdx < cmd.length(); bIdx++) {
             if (!inside) {
-                while (bIdx < cmd.length() && cmd.charAt(bIdx) != '"')
+                while (bIdx < cmd.length() && !isQuote(cmd.charAt(bIdx)))
                     bIdx++;
                 if (bIdx >= cmd.length()) break;
                 inside = !inside;
+                endQuote = cmd.charAt(bIdx);
             } else {
                 boolean escaped = false;
                 for (; bIdx < cmd.length(); bIdx++) {
@@ -248,7 +250,7 @@
                         continue;
                     }
                     // If we reach the other " then stop
-                    if (c == '"' && !escaped) break;
+                    if (c == endQuote && !escaped) break;
                     // Since parsing of attributes and var
                     // substitution is done in separate places,
                     // we need to leave escape in the string
@@ -309,5 +311,9 @@
 
     protected boolean isSpace(char c) {
         return c == ' ' || c == '\n' || c == '\t' || c == '\r';
+    }
+    
+    protected boolean isQuote(char c) {
+        return c == '\'' || c == '\"' || c == '`';
     }
 }

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=424634&r1=424633&r2=424634&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Sat Jul 22 14:48:38 2006
@@ -60,6 +60,10 @@
         <bug>34801</bug>: Partial fix that adds handling of IOExceptions during
         long running CGI requests. Based on a patch by Chris Davey. (markt)
       </fix>
+      <fix>
+        <bug>39689</bug>: Allow single quotes (') and backticks (`) as well as
+        double quotes (") to be used to delimit SSI attribute values. (markt)
+      </fix>
   </changelog>
   </subsection> 
   <subsection name="Webapps">



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


Mime
View raw message