Added error for quotation.

pull/10886/head
Vishal Jain 2021-03-20 22:45:01 -07:00
parent 63a8f285bf
commit c402edd859
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,11 @@ func (es *ExtraOptionSlice) Exists(value string) bool {
// Set parses the string value into a slice
func (es *ExtraOptionSlice) Set(value string) error {
// Check doesn't start or end with a quotation.
if strings.HasPrefix(value, "”") || strings.HasSuffix(value, "”") {
return fmt.Errorf("invalid value: canot contain quotation: %q", value)
}
// The component is the value before the first dot.
componentSplit := strings.SplitN(value, ".", 2)
if len(componentSplit) < 2 {