diff options
author | Nicholas Pease <34464552+LAX18@users.noreply.github.com> | 2023-08-04 10:45:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 14:45:33 +0000 |
commit | 6a7a5ea32ab61a608b52029f778e8df76b04f489 (patch) | |
tree | d86594200ef7841b4f1920309e52cac7c35529d5 | |
parent | 30eae5a40c33b5bfc16dc4244631da7f1cae1494 (diff) | |
download | gitea-6a7a5ea32ab61a608b52029f778e8df76b04f489.tar.gz gitea-6a7a5ea32ab61a608b52029f778e8df76b04f489.zip |
Do not show Profile README when repository is private (#26295)
As mentioned in the original thread (#23260) and in the enhancements PR
#24753, this PR ensures the .profile repository is public before the
README file is shown.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
-rw-r--r-- | routers/web/shared/user/header.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/shared/user/header.go b/routers/web/shared/user/header.go index 516c853b02..0ef93815a3 100644 --- a/routers/web/shared/user/header.go +++ b/routers/web/shared/user/header.go @@ -85,7 +85,7 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) { func FindUserProfileReadme(ctx *context.Context) (profileGitRepo *git.Repository, profileReadmeBlob *git.Blob, profileClose func()) { profileDbRepo, err := repo_model.GetRepositoryByName(ctx.ContextUser.ID, ".profile") - if err == nil && !profileDbRepo.IsEmpty { + if err == nil && !profileDbRepo.IsEmpty && !profileDbRepo.IsPrivate { if profileGitRepo, err = git.OpenRepository(ctx, profileDbRepo.RepoPath()); err != nil { log.Error("FindUserProfileReadme failed to OpenRepository: %v", err) } else { |