Browse Source

Only warn about svg logo once. Closes #1668

pull/1678/head
Gabe Kangas 4 years ago
parent
commit
9226e783ff
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
  1. 7
      controllers/logo.go

7
controllers/logo.go

@ -12,6 +12,8 @@ import ( @@ -12,6 +12,8 @@ import (
log "github.com/sirupsen/logrus"
)
var _hasWarnedSVGLogo = false
// GetLogo will return the logo image as a response.
func GetLogo(w http.ResponseWriter, r *http.Request) {
imageFilename := data.GetLogoPath()
@ -69,7 +71,10 @@ func GetCompatibleLogo(w http.ResponseWriter, r *http.Request) { @@ -69,7 +71,10 @@ func GetCompatibleLogo(w http.ResponseWriter, r *http.Request) {
if referrer == "" {
referrer = "an external site"
}
log.Warnf("%s requested your logo. because many social networks do not support SVGs we returned a placeholder instead. change your current logo \"%s\" to a png or jpeg to be most compatible with external social networking sites.", referrer, imageFilename)
if !_hasWarnedSVGLogo {
log.Warnf("%s requested your logo. because many social networks do not support SVGs we returned a placeholder instead. change your current logo to a png or jpeg to be most compatible with external social networking sites.", referrer)
_hasWarnedSVGLogo = true
}
}
func returnDefault(w http.ResponseWriter) {

Loading…
Cancel
Save