Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
lianhong2758 committed Aug 4, 2023
1 parent f6682f0 commit 5d87fd7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions plugin/bilibili/bilibilipush.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ var (
cache syncx.Map[string, string]
lastUpdateTime time.Time

replacements = map[string]string{
"!": "",
"'": "",
"(": "",
")": "",
"*": "",
}
replacements = [...]string{"!", "'", "(", ")", "*"}
)

func init() {
Expand Down Expand Up @@ -246,8 +240,8 @@ func encWbi(params map[string]string, imgKey string, subKey string) map[string]s
sort.Strings(keys)
// Remove unwanted characters
for k, v := range params {
for old, new := range replacements {
v = strings.ReplaceAll(v, old, new)
for _, old := range replacements {
v = strings.ReplaceAll(v, old, "")
}
params[k] = v
}
Expand Down

0 comments on commit 5d87fd7

Please sign in to comment.