diff --git a/core/src/main/java/org/acegisecurity/taglibs/authz/AuthorizeTag.java b/core/src/main/java/org/acegisecurity/taglibs/authz/AuthorizeTag.java index b59b483b9f..1f35f1295d 100644 --- a/core/src/main/java/org/acegisecurity/taglibs/authz/AuthorizeTag.java +++ b/core/src/main/java/org/acegisecurity/taglibs/authz/AuthorizeTag.java @@ -164,8 +164,16 @@ public class AuthorizeTag extends TagSupport { for (int i = 0; i < authorities.length; i++) { String authority = authorities[i]; - String role = authority.replaceAll("\\s+", ""); - requiredAuthorities.add(new GrantedAuthorityImpl(role)); + + // Remove the role's whitespace characters without depending on JDK 1.4+ + // Includes space, tab, new line, carriage return and form feed. + String role = StringUtils.replace(authority, " ", ""); + role = StringUtils.replace(role, "\t", ""); + role = StringUtils.replace(role, "\r", ""); + role = StringUtils.replace(role, "\n", ""); + role = StringUtils.replace(role, "\f", ""); + + requiredAuthorities.add(new GrantedAuthorityImpl(role)); } return requiredAuthorities; diff --git a/doc/xdocs/changes.xml b/doc/xdocs/changes.xml index d20e01c5a7..966890c235 100644 --- a/doc/xdocs/changes.xml +++ b/doc/xdocs/changes.xml @@ -52,6 +52,7 @@ SiteMinder authentication services (see http://opensource.atlassian.com/projects/spring/browse/SEC-35) Acegifier sample added (see http://opensource.atlassian.com/projects/spring/browse/SEC-1) CVS changes to help new Eclipse-based developers get started + AuthorizeTag no longer depends on JDK 1.4. Tested on Websphere 5.0 w/JDK 1.3 (see http://opensource.atlassian.com/projects/spring/browse/SEC-11) HttpSessionContextIntegrationFilter elegantly handles IOExceptions and ServletExceptions within filter chain (see http://opensource.atlassian.com/projects/spring/browse/SEC-20)