Commit b7c214e9 authored by Adhityaa Chandrasekar's avatar Adhityaa Chandrasekar

commenter_update.go: parse empty links as undefined

parent ea3419e8
......@@ -12,7 +12,9 @@ func commenterUpdate(commenterHex string, email string, name string, link string
// See utils_sanitise.go's documentation on isHttpsUrl. This is not a URL
// validator, just an XSS preventor.
// TODO: reject URLs instead of malforming them.
if link != "undefined" && !isHttpsUrl(link) {
if link == "" {
link = "undefined"
} else if link != "undefined" && !isHttpsUrl(link) {
link = "https://" + link
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment