don't consider tooltip value a valid url if host is empty
This commit is contained in:
parent
405f1c9777
commit
28be902870
1 changed files with 2 additions and 2 deletions
|
|
@ -533,8 +533,8 @@ func (c *compiler) compileReserved(attrs *d2graph.Attributes, f *d2ir.Field) {
|
|||
}
|
||||
|
||||
if attrs.Link != nil && attrs.Tooltip != nil {
|
||||
_, err := url.ParseRequestURI(attrs.Tooltip.Value)
|
||||
if err == nil {
|
||||
u, err := url.ParseRequestURI(attrs.Tooltip.Value)
|
||||
if err == nil && u.Host != "" {
|
||||
c.errorf(scalar, "Tooltip cannot be set to URL when link is also set (for security)")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue