| @@ -241,12 +241,10 @@ | ||
| 241 | 241 | * |
| 242 | 242 | * @return boolean |
| 243 | 243 | */ |
| 244 | 244 | public function record_matches_rules( $record, $exclude_rules ) { |
| 245 | - $matches_needed = count( $exclude_rules ); | |
| 246 | - $matches_found = 0; | |
| 247 | 245 | foreach ( $exclude_rules as $exclude_key => $exclude_value ) { |
| 248 | - if ( ! isset( $record[ $exclude_key ] ) || is_null( $exclude_value ) ) { | |
| 246 | + if ( ! isset( $record[ $exclude_key ] ) ) { | |
| 249 | 247 | continue; |
| 250 | 248 | } |
| 251 | 249 | |
| 252 | 250 | if ( 'ip_address' === $exclude_key ) { |
| @@ -252,16 +250,16 @@ | ||
| 252 | 250 | if ( 'ip_address' === $exclude_key ) { |
| 253 | 251 | $ip_addresses = explode( ',', $exclude_value ); |
| 254 | 252 | |
| 255 | 253 | if ( in_array( $record['ip_address'], $ip_addresses, true ) ) { |
| 256 | - $matches_found++; | |
| 254 | + return true; | |
| 257 | 255 | } |
| 258 | 256 | } elseif ( $record[ $exclude_key ] === $exclude_value ) { |
| 259 | - $matches_found++; | |
| 257 | + return true; | |
| 260 | 258 | } |
| 261 | 259 | } |
| 262 | 260 | |
| 263 | - return $matches_found === $matches_needed; | |
| 261 | + return false; | |
| 264 | 262 | } |
| 265 | 263 | |
| 266 | 264 | /** |
| 267 | 265 | * Get all exclude rules by row because we store them by rule instead. |