Browse Source

定时任务屏蔽违规的字符

pull/364/head
RuoYi 3 years ago
parent
commit
063ee7f773
  1. 2
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
  2. 2
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
  3. 2
      ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java

2
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java

@ -111,5 +111,5 @@ public class Constants
* 定时任务违规的字符
*/
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache" };
"org.springframework", "org.apache", "com.ruoyi.common.utils.file" };
}

2
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java

@ -143,7 +143,7 @@ public class SysJobController extends BaseController
}
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.LOOKUP_LDAP, Constants.LOOKUP_LDAPS }))
{
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap'调用");
return error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'ldap(s)'调用");
}
else if (StringUtils.containsAnyIgnoreCase(job.getInvokeTarget(), new String[] { Constants.HTTP, Constants.HTTPS }))
{

2
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java

@ -121,7 +121,7 @@ public class ScheduleUtils
*/
public static boolean whiteList(String invokeTarget)
{
String packageName = StringUtils.substringBefore(invokeTarget, ")");
String packageName = StringUtils.substringBefore(invokeTarget, "(");
int count = StringUtils.countMatches(packageName, ".");
if (count > 1)
{

Loading…
Cancel
Save