mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
(refs #120)URL encode branch name except '/'.
This commit is contained in:
@@ -67,6 +67,11 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
||||
.replaceAll("\\[user:([^\\s]+?)\\]" , s"""<a href="${context.path}/$$1">$$1</a>""")
|
||||
)
|
||||
|
||||
/**
|
||||
* URL encode except '/'.
|
||||
*/
|
||||
def encodeBranchName(value: String): String = StringUtil.urlEncode(value).replace("%2F", "/")
|
||||
|
||||
def urlEncode(value: String): String = StringUtil.urlEncode(value)
|
||||
|
||||
def urlEncode(value: Option[String]): String = value.map(urlEncode).getOrElse("")
|
||||
|
||||
Reference in New Issue
Block a user