shouwangyw commented on code in PR #16683:
URL: 
https://github.com/apache/dolphinscheduler/pull/16683#discussion_r1794844539


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/ParameterUtils.java:
##########
@@ -314,15 +314,18 @@ private static String dateTemplateParse(String 
templateStr, Date date) {
     /**
      * handle escapes
      *
-     * @param inputString input string
+     * @param str input string
      * @return string filter escapes
      */
-    public static String handleEscapes(String inputString) {
-
-        if (!StringUtils.isEmpty(inputString)) {
-            return inputString.replace("%", "////%").replaceAll("[\n|\r\t]", 
"_");
+    public static String handleEscapes(String str) {
+        str = StringUtils.trim(str);
+        if (StringUtils.isNotBlank(str)) {
+            str = str.replace("\\", "\\\\");
+            str = str.replace("_", "\\_");
+            str = str.replace("%", "\\%");
+            str = str.replaceAll("[\n|\r\t]", "");

Review Comment:
   > > This is a general processing method, and we should not modify it. 
Workflow name and task name should not contain special characters such as `%`. 
We should add verification and documentation when creating it.
   > 
   > This issue only solves the problem of workflow list query. We should 
follow this, and the rest do not belong to this issue.
   
   This issue is not just about solving the workflow list query problem, the 
issue only takes the workflow list as an example.
   This is indeed a general process, this impact range is all places where it 
is used,basically targeting `searchVal`,you can re-evaluate the impact.
   
   <img width="925" alt="image" 
src="https://github.com/user-attachments/assets/815545ce-0b7e-4696-99b8-b9bfea89d7a2";>
   



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