diff options
author | zeripath <art27@cantab.net> | 2021-03-15 21:52:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 17:52:11 -0400 |
commit | 6e423d5573c20b78d6e21cb044e8f4d5de5b288a (patch) | |
tree | 61d2e282bc652b8254271fdd9e19b87a386b5dc7 /models/user.go | |
parent | f268b4896b1030761b28f1f8923d77d87adb8f0b (diff) | |
download | gitea-6e423d5573c20b78d6e21cb044e8f4d5de5b288a.tar.gz gitea-6e423d5573c20b78d6e21cb044e8f4d5de5b288a.zip |
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>
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go index 51c1bb0ce1..098f6af2b3 100644 --- a/models/user.go +++ b/models/user.go @@ -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 |