Browse Source

Unescape sanitized keys and values

pull/1/head
Jan-Lukas Else 1 year ago
parent
commit
b1f828e598
  1. 5
      forms.go

5
forms.go

@ -2,6 +2,7 @@ package main
import (
"github.com/microcosm-cc/bluemonday"
"html"
"net/http"
"net/url"
)
@ -33,9 +34,9 @@ func sanitizeForm(values url.Values) FormValues {
for key, values := range values {
var sanitizedValues []string
for _, value := range values {
sanitizedValues = append(sanitizedValues, p.Sanitize(value))
sanitizedValues = append(sanitizedValues, html.UnescapeString(p.Sanitize(value)))
}
sanitizedForm[p.Sanitize(key)] = sanitizedValues
sanitizedForm[html.UnescapeString(p.Sanitize(key))] = sanitizedValues
}
return sanitizedForm
}

Loading…
Cancel
Save