1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-21 17:08:27 +00:00

Add more checks in migration code (#21011) (#21050)

Backport #21011

When migrating add several more important sanity checks:

* SHAs must be SHAs
* Refs must be valid Refs
* URLs must be reasonable

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath
2022-09-04 14:41:21 +01:00
committed by GitHub
parent bd1412c3af
commit 3aba72c613
24 changed files with 714 additions and 302 deletions

View File

@@ -243,6 +243,7 @@ func (r *RepositoryRestorer) GetPullRequests(page, perPage int) ([]*base.PullReq
}
for _, pr := range pulls {
pr.PatchURL = "file://" + filepath.Join(r.baseDir, pr.PatchURL)
CheckAndEnsureSafePR(pr, "", r)
}
return pulls, true, nil
}