Commits

Anonymous committed dfaa5c0

XW-705 ParametersInterceptor is not filtering acceptParams properly

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@2004e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 52ecc42

Comments (0)

Files changed (2)

File core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java

             return true;
         }
         return false;
-    }
+    }    
 
     protected boolean isAccepted(String paramName) {
         if (!this.acceptParams.isEmpty()) {
                     return true;
                 }
             }
-        }
-        return acceptedPattern.matcher(paramName).matches();
+            return false;
+        } else
+            return acceptedPattern.matcher(paramName).matches();
     }
 
     protected boolean isExcluded(String paramName) {

File core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java

         Map<String, Object> params = new HashMap<String, Object>() {
             {
                 put("blah", "This is blah");
-                put("['baz']", "123");
+                put("baz", "123");
                 put("name", "try_1");
                 put("(name)", "try_2");
                 put("['name']", "try_3");
         SimpleAction action = (SimpleAction) proxy.getAction();
         assertNull(action.getName());
         assertEquals("This is blah", (action).getBlah());
-         assertEquals(123, action.getBaz());
+        assertEquals(123, action.getBaz());
     }