Skip to content

Commit

Permalink
Merge pull request #1513 from xwp/fix/1349-strlen-compat
Browse files Browse the repository at this point in the history
Replace `strlen` with custom callback that accepts `null`
  • Loading branch information
delawski authored Jul 22, 2024
2 parents c6e12ba + 9d47e25 commit 46203c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion classes/class-log.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ public function is_record_excluded( $connector, $context, $action, $user = null,
'role' => ( ! empty( $exclude_rule['author_or_role'] ) && ! is_numeric( $exclude_rule['author_or_role'] ) ) ? $exclude_rule['author_or_role'] : null,
);

$exclude_rules = array_filter( $exclude, 'strlen' );
$exclude_rules = array_filter(
$exclude,
function ( $value ) {
return ! is_null( $value );
}
);

if ( $this->record_matches_rules( $record, $exclude_rules ) ) {
$exclude_record = true;
Expand Down

0 comments on commit 46203c9

Please sign in to comment.