Skip to content

Commit 778789a

Browse files
safroniksafronik
authored andcommitted
Fix: Adding admin IP to whitelist during the login in and plugin activation #2.
1 parent 4fd7f59 commit 778789a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cleantalk.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,7 @@ function apbct_activation( $network = false ) {
601601

602602
// Additional options
603603
add_option( 'ct_plugin_do_activation_redirect', true );
604-
global $user;
605-
apbct_add_admin_ip_to_swf_whitelist( $user->user_login, $user );
604+
apbct_add_admin_ip_to_swf_whitelist( null, null );
606605

607606
}
608607

inc/cleantalk-common.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,8 @@ function apbct_add_async_attribute($tag, $handle, $src) {
11021102
function apbct_add_admin_ip_to_swf_whitelist( $user_login, $user ) {
11031103

11041104
global $apbct;
1105-
1105+
1106+
$user = ! $user instanceof WP_User ? apbct_wp_get_current_user() : $user;
11061107
$ip = Helper::ip__get( 'real', true );
11071108

11081109
if(

0 commit comments

Comments
 (0)