fix unescaped default values

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter committed 2022-05-05 13:35:56 +02:00
1 parent 3c0928f0a2
commit 1e8fe52b3a
1 file changed
+2 -1
@@ -2,6 +2,7 @@ package main
import (
"fmt"
"html"
"io/ioutil"
"log"
"os"
@@ -76,7 +77,7 @@ func GetAnnotatedVariables(s interface{}) []ConfigField {
continue
}
v := fmt.Sprintf("%v", value.Interface())
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: v, Description: desc, Type: value.Type().Name()})
fields = append(fields, ConfigField{Name: strings.ReplaceAll(env, ";", "<br/>"), DefaultValue: html.EscapeString(strings.Replace(v, "|", "\\|", -1)), Description: desc, Type: value.Type().Name()})
case reflect.Ptr:
// PolicySelectors in the Proxy are being skipped atm
// they are not configurable via env vars, if that changes