mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 17:20:53 +02:00
Ensure validation occurs on clone addresses too (#14994)
* Ensure validation occurs on clone addresses too Fix #14984 Signed-off-by: Andrew Thornton <art27@cantab.net> * fix lint Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix api tests Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
1 parent
f268b4896b
commit
6e423d5573
10 files changed
+166
-130
No files matched your search
+1
-1
@@ -296,7 +296,7 @@ func (u *User) CanEditGitHook() bool {
|
||||
|
||||
// CanImportLocal returns true if user can migrate repository by local path.
|
||||
func (u *User) CanImportLocal() bool {
|
||||
if !setting.ImportLocalPaths {
|
||||
if !setting.ImportLocalPaths || u == nil {
|
||||
return false
|
||||
}
|
||||
return u.IsAdmin || u.AllowImportLocal
|
||||
|
||||
Reference in new issue
Block a user