File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,14 @@ function apbct_sfw_send_logs(){
52
52
*/
53
53
function apbct__plugin_get_latest_version () {
54
54
$ path_to_config = CLEANTALK_ROOT . 'config.php ' ;
55
+ global $ antispam_activity_status ;
55
56
56
57
$ updater = new \Cleantalk \Updater \Updater ( CLEANTALK_ROOT );
57
58
$ latest_version = $ updater ->getLatestVersion ();
58
59
File::clean__variable ($ path_to_config , 'latest_version ' );
59
60
File::inject__variable ($ path_to_config , 'latest_version ' , $ latest_version );
60
- File::clean__variable (CLEANTALK_CONFIG_FILE , 'antispam_activity_status ' );
61
- File::inject__variable (CLEANTALK_CONFIG_FILE , 'antispam_activity_status ' , true );
61
+ if (! isset ($ antispam_activity_status )) {
62
+ File::clean__variable ($ path_to_config , 'antispam_activity_status ' );
63
+ File::inject__variable ($ path_to_config , 'antispam_activity_status ' , true );
64
+ }
62
65
}
Original file line number Diff line number Diff line change 55
55
$ path_to_config = CLEANTALK_ROOT . 'config.php ' ;
56
56
$ apikey = Post::get ( 'apikey ' );
57
57
global $ account_name_ob ;
58
+ global $ antispam_activity_status ;
58
59
59
60
/**
60
61
* Apikey validation
79
80
die (Err::add ('Please, enter the access key ' )->get_last ( 'as_json ' ));
80
81
}
81
82
83
+ if (! isset ($ antispam_activity_status ) && Post::is_set ( 'antispam_activity_status ' )) {
84
+ File::clean__variable ($ path_to_config , 'antispam_activity_status ' );
85
+ File::inject__variable ($ path_to_config , 'antispam_activity_status ' , (bool )Post::get ( 'antispam_activity_status ' ));
86
+ } else {
87
+ File::replace__variable ( $ path_to_config , 'antispam_activity_status ' , (bool )Post::get ( 'antispam_activity_status ' ) );
88
+ }
89
+
82
90
File::replace__variable ( $ path_to_config , 'apikey ' , $ apikey );
83
- File::replace__variable ( $ path_to_config , 'antispam_activity_status ' , (bool )Post::get ( 'antispam_activity_status ' ) );
84
91
File::replace__variable ( $ path_to_config , 'registrations_test ' , (bool )Post::get ( 'registrations_test ' ) );
85
92
File::replace__variable ( $ path_to_config , 'general_postdata_test ' , (bool )Post::get ( 'general_postdata_test ' ) );
86
93
File::replace__variable ( $ path_to_config , 'spam_firewall ' , (bool )Post::get ( 'spam_firewall ' ) );
You can’t perform that action at this time.
0 commit comments