Author: markt Date: Sat Jul 22 14:48:51 2006 New Revision: 424635 URL: http://svn.apache.org/viewvc?rev=424635&view=rev Log: Port fix bug 39689. Allow same quoting for SSI attribute values as httpd.
Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIProcessor.java Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIProcessor.java?rev=424635&r1=424634&r2=424635&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIProcessor.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ssi/SSIProcessor.java Sat Jul 22 14:48:51 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 == '`'; } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]