@@ -11,7 +11,6 @@ import (
11
11
"github.com/OpenListTeam/OpenList/v4/internal/model"
12
12
"github.com/OpenListTeam/OpenList/v4/internal/op"
13
13
"github.com/OpenListTeam/OpenList/v4/pkg/generic"
14
- "github.com/OpenListTeam/OpenList/v4/pkg/utils"
15
14
"github.com/OpenListTeam/OpenList/v4/server/common"
16
15
"github.com/gin-gonic/gin"
17
16
"github.com/pkg/errors"
@@ -174,7 +173,7 @@ func FsBatchRename(c *gin.Context) {
174
173
if renameObject .SrcName == "" || renameObject .NewName == "" {
175
174
continue
176
175
}
177
- renameObject . NewName , err = utils . CheckRelativePath (renameObject .NewName )
176
+ err = checkRelativePath (renameObject .NewName )
178
177
if err != nil {
179
178
common .ErrorResp (c , err , 403 )
180
179
return
@@ -235,7 +234,8 @@ func FsRegexRename(c *gin.Context) {
235
234
236
235
for _ , file := range files {
237
236
if srcRegexp .MatchString (file .GetName ()) {
238
- newFileName , err := utils .CheckRelativePath (srcRegexp .ReplaceAllString (file .GetName (), req .NewNameRegex ))
237
+ newFileName := srcRegexp .ReplaceAllString (file .GetName (), req .NewNameRegex )
238
+ err := checkRelativePath (newFileName )
239
239
if err != nil {
240
240
common .ErrorResp (c , err , 403 )
241
241
return
0 commit comments