mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Limit uploaded avatar image-size to 4096x3072 by default (#4353)
This commit is contained in:
		
				
					committed by
					
						
						Lauris BH
					
				
			
			
				
	
			
			
			
						parent
						
							69796ddd64
						
					
				
				
					commit
					cbee921c28
				
			@@ -341,6 +341,8 @@ var (
 | 
			
		||||
 | 
			
		||||
	// Picture settings
 | 
			
		||||
	AvatarUploadPath      string
 | 
			
		||||
	AvatarMaxWidth        int
 | 
			
		||||
	AvatarMaxHeight       int
 | 
			
		||||
	GravatarSource        string
 | 
			
		||||
	GravatarSourceURL     *url.URL
 | 
			
		||||
	DisableGravatar       bool
 | 
			
		||||
@@ -1024,6 +1026,8 @@ func NewContext() {
 | 
			
		||||
	if !filepath.IsAbs(AvatarUploadPath) {
 | 
			
		||||
		AvatarUploadPath = path.Join(AppWorkPath, AvatarUploadPath)
 | 
			
		||||
	}
 | 
			
		||||
	AvatarMaxWidth = sec.Key("AVATAR_MAX_WIDTH").MustInt(4096)
 | 
			
		||||
	AvatarMaxHeight = sec.Key("AVATAR_MAX_HEIGHT").MustInt(3072)
 | 
			
		||||
	switch source := sec.Key("GRAVATAR_SOURCE").MustString("gravatar"); source {
 | 
			
		||||
	case "duoshuo":
 | 
			
		||||
		GravatarSource = "http://gravatar.duoshuo.com/avatar/"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user