| @@ -79,9 +79,9 @@ | ||
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $spam_comments_ip = Spam_Comment::get_spam_comments_ip(); |
| 83 | - if ( ! empty( $spam_comments_ip ) ) { | |
| 83 | + if ( array() !== $spam_comments_ip ) { | |
| 84 | 84 | // Add spam comments IP to the compact log. |
| 85 | 85 | $this->log( $spam_comments_ip, 'spam-comment.log' ); |
| 86 | 86 | |
| 87 | 87 | foreach ( $spam_comments_ip as $ip => $count ) { |
| @@ -105,9 +105,9 @@ | ||
| 105 | 105 | $logs = array(); |
| 106 | 106 | // Retrieve the current list of blocked IPs from the site transient. |
| 107 | 107 | $ips = get_site_transient( \WP_Defender\Controller\Firewall_Logs::AKISMET_BLOCKED_IPS ); |
| 108 | 108 | // Ensure the retrieved data is an array; if not, initialize it as an empty array. |
| 109 | - if ( is_array( $ips ) && ! empty( $ips ) ) { | |
| 109 | + if ( is_array( $ips ) && array() !== $ips ) { | |
| 110 | 110 | $this->log( $ips, 'spam-comment.log' ); |
| 111 | 111 | |
| 112 | 112 | foreach ( $ips as $ip => $count ) { |
| 113 | 113 | if ( ! isset( $logs[ $ip ] ) ) { |