mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-07 02:07:05 +02:00
(refs #715)Escape $ in replacement string
This commit is contained in:
@@ -148,7 +148,7 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
|
||||
import scala.util.matching.Regex._
|
||||
implicit class RegexReplaceString(s: String) {
|
||||
def replaceAll(pattern: String, replacer: (Match) => String): String = {
|
||||
pattern.r.replaceAllIn(s, replacer)
|
||||
pattern.r.replaceAllIn(s, (m: Match) => replacer(m).replace("$", "\\$"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user