File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import (
10
10
11
11
"code.gitea.io/gitea/modules/setting"
12
12
"code.gitea.io/gitea/modules/timeutil"
13
- "code.gitea.io/gitea/modules/util"
14
13
15
14
"xorm.io/builder"
16
15
"xorm.io/xorm"
@@ -100,7 +99,7 @@ type ReactionOptions struct {
100
99
101
100
// CreateReaction creates reaction for issue or comment.
102
101
func CreateReaction (opts * ReactionOptions ) (reaction * Reaction , err error ) {
103
- if ! util . IsStringInSlice ( opts . Type , setting .UI .Reactions ) {
102
+ if ! setting .UI .ReactionsMap [ opts . Type ] {
104
103
return nil , ErrForbiddenIssueReaction {opts .Type }
105
104
}
106
105
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ var (
171
171
DefaultTheme string
172
172
Themes []string
173
173
Reactions []string
174
+ ReactionsMap map [string ]bool
174
175
SearchRepoDescription bool
175
176
UseServiceWorker bool
176
177
@@ -985,6 +986,11 @@ func NewContext() {
985
986
U2F .AppID = sec .Key ("APP_ID" ).MustString (strings .TrimRight (AppURL , "/" ))
986
987
987
988
zip .Verbose = false
989
+
990
+ UI .ReactionsMap = make (map [string ]bool )
991
+ for _ , reaction := range UI .Reactions {
992
+ UI .ReactionsMap [reaction ] = true
993
+ }
988
994
}
989
995
990
996
func loadInternalToken (sec * ini.Section ) string {
You can’t perform that action at this time.
0 commit comments