Re-fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45015
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 25 Mar 2010 22:46:12 +0000 (22:46 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 25 Mar 2010 22:46:12 +0000 (22:46 +0000)
Regression in recent parsing re-factoring

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

java/org/apache/jasper/compiler/AttributeParser.java
java/org/apache/jasper/compiler/Parser.java

index c19fac7..708c0d6 100644 (file)
@@ -122,9 +122,7 @@ public class AttributeParser {
             boolean strict) {
         this.input = input;
         this.quote = quote;
-        // If quote is null this is a scriptign expressions and any EL syntax
-        // should be ignored
-        this.isELIgnored = isELIgnored || (quote == 0);
+        this.isELIgnored = isELIgnored;
         this.isDeferredSyntaxAllowedAsLiteral =
             isDeferredSyntaxAllowedAsLiteral;
         this.strict = strict;
index 7cfb2bc..a21b1c1 100644 (file)
@@ -244,12 +244,15 @@ class Parser implements TagConstants {
 
         String ret = null;
         try {
-            char quote = 0;
-            if (watch.length() == 1) {
-                quote = watch.charAt(0);
-            }
+            char quote = watch.charAt(watch.length() - 1);
+            
+            // If watch is longer than 1 character this is a scripting
+            // expression and EL is always ignored
+            boolean isElIgnored =
+                pageInfo.isELIgnored() || watch.length() > 1;
+            
             ret = AttributeParser.getUnquoted(reader.getText(start, stop),
-                    quote, pageInfo.isELIgnored(),
+                    quote, isElIgnored,
                     pageInfo.isDeferredSyntaxAllowedAsLiteral());
         } catch (IllegalArgumentException iae) {
             err.jspError(start, iae.getMessage());