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)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user