cookiesName which if matched will allow the cookie
* to be injected into action, could be comma-separated string.
@@ -208,12 +212,13 @@ public class CookieInterceptor extends AbstractInterceptor {
}
/**
- * Set the acceptCookieNames pattern of allowed names of cookies to protect against remote command execution vulnerability
+ * Set the acceptCookieNames pattern of allowed names of cookies
+ * to protect against remote command execution vulnerability.
*
- * @param pattern used to check cookie name against
+ * @param commaDelimitedPattern is used to check cookie name against, can set of comma delimited patterns
*/
- public void setAcceptCookieNames(String pattern) {
- acceptedPattern = Pattern.compile(pattern);
+ public void setAcceptCookieNames(String commaDelimitedPattern) {
+ acceptedPatternsChecker.setAcceptedPatterns(commaDelimitedPattern);
}
public String intercept(ActionInvocation invocation) throws Exception {
@@ -280,17 +285,17 @@ public class CookieInterceptor extends AbstractInterceptor {
* @return true|false
*/
protected boolean isAccepted(String name) {
- boolean matches = acceptedPattern.matcher(name).matches();
- if (matches) {
+ AcceptedPatternsChecker.IsAccepted accepted = acceptedPatternsChecker.isAccepted(name);
+ if (accepted.isAccepted()) {
if (LOG.isTraceEnabled()) {
- LOG.trace("Cookie [#0] matches acceptedPattern [#1]", name, ACCEPTED_PATTERN);
- }
- } else {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Cookie [#0] doesn't match acceptedPattern [#1]", name, ACCEPTED_PATTERN);
+ LOG.trace("Cookie [#0] matches acceptedPattern [#1]", name, accepted.getAcceptedPattern());
}
+ return true;
}
- return matches;
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Cookie [#0] doesn't match acceptedPattern [#1]", name, accepted.getAcceptedPattern());
+ }
+ return false;
}
/**
diff --git a/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITagBeanInfo.java b/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITagBeanInfo.java
index 87e410515..21c5d0029 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITagBeanInfo.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITagBeanInfo.java
@@ -45,15 +45,20 @@ public class AbstractUITagBeanInfo extends SimpleBeanInfo {
List<s:datetext/>works only with the JavaTemplates Plugin!
- Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. - The framework is designed to streamline the full development cycle, - from building, to deploying, to maintaining applications over time. -
- -- Apache Struts 2 was originally known as WebWork 2. - After working independently for several years, - the WebWork and Struts communities joined forces to create Struts2. - This new version of Struts is simpler to use and - closer to how Struts was always meant to be. -
-|
- #set($aname=$currentVersion.replaceAll('\.', ""))
-
-
-
- version ${currentVersion}
-
-
- - Download Now - - |
-
-
-
- Get Started
-
-
-
- |
-
-
-
- Plugin Registry
-
-
-
- |
- Build!
-
|
- |
- Deploy!
-
|
-
- Maintain!
-
|
-
- To download the framework, visit - - Apache Struts Distributions. - - For more about Apache Struts 2, visit - - Getting Started. - - For more about framework extensions, visit the - - Struts 2 Plugin Registry. - - For help with migrating, visit our - - Migration Guide. - -
-- Apache Struts 2 requires: -
- -- For a full list of requirements, including dependencies used by optional plugins, - see Project Dependencies -
- -Apache Struts is distributed under the Apache License, Version 2.0
-