File tree 1 file changed +11
-8
lines changed 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -37,20 +37,23 @@ function get_vardump($var) {
37
37
}
38
38
};
39
39
40
- for ($ i =0 ; $ i <sizeof ($ config ["plugins " ]); $ i ++) {
41
- $ actual_plugin = include "plugins/ " .$ config ["plugins " ][$ i ];
40
+ foreach ($ config ["plugins " ] as $ plugin ) {
41
+ $ actual_plugin = include_once "plugins/ " .$ plugin ;
42
+ $ actioned = false ;
42
43
if (isset ($ actual_plugin ["pre_process " ])) {
43
- call_user_func ($ actual_plugin ["pre_process " ], $ bot , $ msg, $ matches );
44
+ call_user_func ($ actual_plugin ["pre_process " ], $ msg );
44
45
};
45
46
if (isset ($ actual_plugin ["exe " ])) {
46
- for ($ m = 0 ; $ m < sizeof ( $ actual_plugin ["patterns " ]); $ m ++ ) {
47
- preg_match ($ actual_plugin [ " patterns " ][ $ m ] , $ msg ["text " ], $ matches , PREG_OFFSET_CAPTURE );
47
+ foreach ($ actual_plugin ["patterns " ] as $ pattern ) {
48
+ preg_match ($ pattern , $ msg ["text " ], $ matches , PREG_OFFSET_CAPTURE );
48
49
if ($ matches ) {
49
- call_user_func ($ actual_plugin ["exe " ], $ bot , $ msg , $ matches );
50
+ call_user_func ($ actual_plugin ["exe " ], $ msg , $ matches );
51
+ $ actioned = true ;
50
52
break ;
51
- }
52
- }
53
+ };
54
+ };
53
55
};
56
+ if ($ actioned ) { break ; };
54
57
};
55
58
56
59
ini_set ('display_errors ' , 1 );
You can’t perform that action at this time.
0 commit comments