pinkfloyds opened a new pull request, #15824:
URL: https://github.com/apache/dolphinscheduler/pull/15824

   ## Purpose of the pull request
   resource center file path illegal character check filter 
   
   ## Brief change log
   
   > 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/CheckUtils.java
   `/**
        * regex FilePath check,only use a-z A-Z 0-9 _./- and excluding ..
        *
        * @param str     input string
        * @return true if regex pattern is right, otherwise return false
        */
       public static boolean checkFilePath(String str) {
           return regexChecks(str, Constants.REGEX_FILE_PATH) && 
!str.contains("..");
       }`
   > 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
   
   `// abnormal characters check
           if (!checkFilePath(fullName)){
               log.error("fullName contains illegal characters");
               throw new ServiceException(Status.ILLEGAL_RESOURCE_PATH);
           }`
   
   ## Verify this pull request
   
   Manually verified the change by testing locally.
   Added test case testCheckFilePath in CheckUtilsTest.
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to