| @@ -27,15 +27,15 @@ | ||
| 27 | 27 | $offset = 0; |
| 28 | 28 | $limit = 100; |
| 29 | 29 | $mu_spam_ips = array(); |
| 30 | 30 | while ( $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs} LIMIT {$offset}, {$limit}", ARRAY_A ) ) { // phpcs:ignore |
| 31 | - if ( ! empty( $blogs ) && is_array( $blogs ) ) { | |
| 31 | + if ( is_array( $blogs ) && array() !== $blogs ) { | |
| 32 | 32 | foreach ( $blogs as $blog ) { |
| 33 | 33 | switch_to_blog( $blog['blog_id'] ); |
| 34 | 34 | |
| 35 | 35 | $mu_spam_ips = self::fetch_manual_spam_comments_ip(); |
| 36 | 36 | |
| 37 | - if ( ! empty( $mu_spam_ips ) && is_array( $mu_spam_ips ) ) { | |
| 37 | + if ( is_array( $mu_spam_ips ) && array() !== $mu_spam_ips ) { | |
| 38 | 38 | foreach ( $mu_spam_ips as $ip => $count ) { |
| 39 | 39 | $spam_ips[ $ip ] = isset( $spam_ips[ $ip ] ) |
| 40 | 40 | ? $spam_ips[ $ip ] + $count |
| 41 | 41 | : $count; |
| @@ -74,9 +74,9 @@ | ||
| 74 | 74 | |
| 75 | 75 | $results = $wpdb->get_results( $sql, ARRAY_A ); // phpcs:ignore |
| 76 | 76 | |
| 77 | 77 | $spam_ips = array(); |
| 78 | - if ( is_array( $results ) && ! empty( $results ) ) { | |
| 78 | + if ( is_array( $results ) && array() !== $results ) { | |
| 79 | 79 | foreach ( $results as $row ) { |
| 80 | 80 | $spam_ips[ $row['ip'] ] = (int) $row['count']; |
| 81 | 81 | } |
| 82 | 82 | } |