Skip to content

Commit

Permalink
Relative URIs are considered safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Darren Coxall committed Dec 9, 2013
1 parent d0e587a commit 59358ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inline.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ func autoLink(p *parser, out *bytes.Buffer, data []byte, offset int) int {
return linkEnd - rewind return linkEnd - rewind
} }


var validUris = [][]byte{[]byte("http://"), []byte("https://"), []byte("ftp://"), []byte("mailto://")} var validUris = [][]byte{[]byte("http://"), []byte("https://"), []byte("ftp://"), []byte("mailto://"), []byte("/")}


func isSafeLink(link []byte) bool { func isSafeLink(link []byte) bool {
for _, prefix := range validUris { for _, prefix := range validUris {
Expand Down

0 comments on commit 59358ad

Please sign in to comment.