1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-13 13:08:19 +00:00

backport(#4091): Fix #4090 by escaping filename page/img link (without path) for short link (#4254)

This commit is contained in:
Antoine GIRARD
2018-06-17 09:33:44 +02:00
committed by Lunny Xiao
parent c746f820ab
commit 00ad4745ba
2 changed files with 29 additions and 0 deletions

View File

@@ -405,6 +405,9 @@ func RenderShortLinks(rawBytes []byte, urlPrefix string, noLink bool, isWikiMark
} else {
link = strings.Replace(link, " ", "-", -1)
}
if !strings.Contains(link, "/") {
link = url.PathEscape(link)
}
}
if image {
if !absoluteLink {