yasserzamani commented on a change in pull request #425:
URL: https://github.com/apache/struts/pull/425#discussion_r455667021



##########
File path: 
core/src/main/java/com/opensymphony/xwork2/security/DefaultAcceptedPatternsChecker.java
##########
@@ -35,7 +37,11 @@
     private static final Logger LOG = 
LogManager.getLogger(DefaultAcceptedPatternsChecker.class);
 
     public static final String[] ACCEPTED_PATTERNS = {
-            
"\\w+((\\.\\w+)|(\\[\\d+\\])|(\\(\\d+\\))|(\\['(\\w|[\\u4e00-\\u9fa5])+'\\])|(\\('(\\w|[\\u4e00-\\u9fa5])+'\\)))*"
+            
"\\w+((\\.\\w+)|(\\[\\d+])|(\\(\\d+\\))|(\\['(\\w|[\\u4e00-\\u9fa5])+'])|(\\('(\\w|[\\u4e00-\\u9fa5])+'\\)))*"

Review comment:
       Ah sorry [it was 
right](https://stackoverflow.com/questions/43044918/why-closing-square-bracket-doesnt-require-escaping-in-java-regex).
   
   And I spotted it's nice I think to refactor 
`((\\.\\w+)|(\\[\\d+\\])|(\\(\\d+\\))|(\\['(\\w|[\\u4e00-\\u9fa5])+'\\])|(\\('(\\w|[\\u4e00-\\u9fa5])+'\\)))*`
 part e.g. named `EXTENSION_PATTERN` or so because it's same in both.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to