Includes check for braces in expression

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/58a58615
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/58a58615
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/58a58615

Branch: refs/heads/develop
Commit: 58a58615cf45c669800deafd462f7c427b677caf
Parents: aff3a3a
Author: Lukasz Lenart <lukaszlen...@apache.org>
Authored: Sat Apr 26 06:57:42 2014 +0200
Committer: Lukasz Lenart <lukaszlen...@apache.org>
Committed: Sat Apr 26 06:57:42 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/58a58615/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
----------------------------------------------------------------------
diff --git 
a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java 
b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
index a0231bc..81f9700 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
@@ -309,7 +309,8 @@ public class OgnlUtil {
         if (tree instanceof SimpleNode) {
             SimpleNode node = (SimpleNode) tree;
             for (String excludedPattern : excludedProperties) {
-                if (excludedPattern.equalsIgnoreCase(node.toString())) {
+                // TODO lukaszlenart: need a better way to check 'toString' 
and 'toString()' call
+                if (excludedPattern.equalsIgnoreCase(node.toString()) || 
(excludedPattern + "()").equalsIgnoreCase(node.toString())) {
                     throw new OgnlException("Tree [" + (parent != null ? 
parent : tree) + "] trying access excluded pattern [" + excludedPattern + "]");
                 }
                for (int i = 0; i < node.jjtGetNumChildren(); i++) {

Reply via email to