Sfoglia il codice sorgente

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>
tags/v1.21.0-rc0
Nicholas Pease 10 mesi fa
parent
commit
6a7a5ea32a
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1
    1
      routers/web/shared/user/header.go

+ 1
- 1
routers/web/shared/user/header.go Vedi File

@@ -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 {

Loading…
Annulla
Salva