File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,15 @@ public function indexAction(): void
86
86
->on (
87
87
EventRuleConfigForm::ON_DELETE ,
88
88
function (EventRuleConfigForm $ form ) use ($ ruleId , $ eventRuleConfigValues ) {
89
- $ form ->removeRule ((int ) $ ruleId );
90
- Notification::success (
91
- sprintf (t ('Successfully deleted event rule %s ' ), $ eventRuleConfigValues ['name ' ])
92
- );
93
- $ this ->redirectNow ('__CLOSE__ ' );
89
+ $ csrf = $ form ->getElement ('CSRFToken ' );
90
+ if ($ csrf !== null && $ csrf ->isValid ()) {
91
+ $ form ->removeRule ((int ) $ ruleId );
92
+ Notification::success (
93
+ sprintf (t ('Successfully deleted event rule %s ' ), $ eventRuleConfigValues ['name ' ])
94
+ );
95
+
96
+ $ this ->redirectNow ('__CLOSE__ ' );
97
+ }
94
98
}
95
99
)
96
100
->handleRequest ($ this ->getServerRequest ());
You can’t perform that action at this time.
0 commit comments