aboutsummaryrefslogtreecommitdiffstats
path: root/services/migrations
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-03-08 20:17:39 +0800
committerGitHub <noreply@github.com>2023-03-08 20:17:39 +0800
commitb116418f05b822481bba3613873eef876da73814 (patch)
tree65d1d88d940c26029e7ef920c4dd30761763ce46 /services/migrations
parent090e75392385041b3abb30d02564962a3ff687f6 (diff)
downloadgitea-b116418f05b822481bba3613873eef876da73814.tar.gz
gitea-b116418f05b822481bba3613873eef876da73814.zip
Use CleanPath instead of path.Clean (#23371)
As title.
Diffstat (limited to 'services/migrations')
-rw-r--r--services/migrations/gitea_uploader.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go
index 8b259a362b..ca961524d1 100644
--- a/services/migrations/gitea_uploader.go
+++ b/services/migrations/gitea_uploader.go
@@ -9,7 +9,6 @@ import (
"fmt"
"io"
"os"
- "path"
"path/filepath"
"strconv"
"strings"
@@ -30,6 +29,7 @@ import (
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/uri"
+ "code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/pull"
"github.com/google/uuid"
@@ -866,7 +866,7 @@ func (g *GiteaLocalUploader) CreateReviews(reviews ...*base.Review) error {
}
// SECURITY: The TreePath must be cleaned!
- comment.TreePath = path.Clean("/" + comment.TreePath)[1:]
+ comment.TreePath = util.CleanPath(comment.TreePath)
var patch string
reader, writer := io.Pipe()