Skip to content

Commit

Permalink
udf bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
taoran1250 committed Jan 13, 2025
1 parent a9340e3 commit 79f8416
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
*/

package org.apache.linkis.udf.api;

import org.apache.commons.lang3.StringUtils;
import org.springframework.util.StringUtils;
import org.apache.linkis.common.conf.Configuration;
import org.apache.linkis.common.io.FsPath;
import org.apache.linkis.server.Message;
Expand Down Expand Up @@ -1448,7 +1447,7 @@ public Message pythonUpload(
public Message getRegisterFunctions(HttpServletRequest req, @RequestParam("path") String path)
throws IOException {
// 使用正则校验path,防止命令注入漏洞
if (StringUtils.isBlank(path) || !path.matches("^[a-zA-Z0-9_.-/:]+$")) {
if (StringUtils.isEmpty(path) || !path.matches("^[a-zA-Z0-9_.-/:]+$")) {
return Message.error("path参数格式错误");
}
if (StringUtils.endsWithIgnoreCase(path, Constants.FILE_EXTENSION_PY)
Expand Down

0 comments on commit 79f8416

Please sign in to comment.