فهرست منبع

Changed AuthorizeTag to use StringUtils.deleteAny(), instead of replace()

Luke Taylor 17 سال پیش
والد
کامیت
48620f3550
1فایلهای تغییر یافته به همراه1 افزوده شده و 4 حذف شده
  1. 1 4
      core/src/main/java/org/springframework/security/taglibs/authz/AuthorizeTag.java

+ 1 - 4
core/src/main/java/org/springframework/security/taglibs/authz/AuthorizeTag.java

@@ -151,10 +151,7 @@ public class AuthorizeTag extends TagSupport {
             // Remove the role's whitespace characters without depending on JDK 1.4+
             // Includes space, tab, new line, carriage return and form feed.
             String role = authority.trim(); // trim, don't use spaces, as per SEC-378
-            role = StringUtils.replace(role, "\t", "");
-            role = StringUtils.replace(role, "\r", "");
-            role = StringUtils.replace(role, "\n", "");
-            role = StringUtils.replace(role, "\f", "");
+            role = StringUtils.deleteAny(role, "\t\n\r\f");
 
             requiredAuthorities.add(new GrantedAuthorityImpl(role));
         }