Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions inc/spbc-firewall.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,25 @@ function spbc_firewall_skip_check()
}
}

// Legacy bypass: keep the old IP/API-key cookie mechanism for the transition period.
$ip_set = IP::get();
$ip_set = empty($ip_set) ? array() : $ip_set;
$ip_set = is_array($ip_set) ? $ip_set : array($ip_set);
foreach ( $ip_set as $spbc_cur_ip ) {
if ( Cookie::getString('spbc_firewall_pass_key') === md5($spbc_cur_ip . $spbc->settings['spbc_key']) ) {
return true;
}
}

// Turn off the SpamFireWall if Remote Call is in progress
if ( ( ! empty($apbct) && $apbct->rc_running ) || $spbc->rc_running ) {
return true;
}

// Pass the check if cookie is set.
$ip_set = IP::get();
$ip_set = empty($ip_set) ? [] : $ip_set;
$ip_set = is_array($ip_set) ? $ip_set : [$ip_set];
foreach ( $ip_set as $spbc_cur_ip ) {
if ( Cookie::getString('spbc_firewall_pass_key') == md5($spbc_cur_ip . $spbc->settings['spbc_key']) ) {
return true;
}
// Emergency bypass: consume the one-time link from the admin email, then check the granted bypass.
Firewall\FirewallBypass::maybeSetUserToken();
if (Firewall\FirewallBypass::bypassByUserToken()) {
return true;
}
Comment on lines +278 to 281

return false;
Expand Down
3 changes: 3 additions & 0 deletions inc/spbc-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,9 @@ function spbc_format_security_log_event($event, $url, $page_time = null, $show_p
case 'logout':
$formatted = __('Logout', 'security-malware-firewall');
break;
case 'fw_bypass':
$formatted = __('Firewall bypass activated', 'security-malware-firewall');
break;
default:
$formatted = esc_html((string) $event);
break;
Expand Down
Loading
Loading