xwp / stream

🗄️ Stream plugin for WordPress
https://wordpress.org/plugins/stream/
GNU General Public License v2.0
405 stars 119 forks source link

Adjust exclude rules filtering to avoid passing null to strlen() to fix PHP 8 deprecation notice #1466

Open ocean90 opened 8 months ago

ocean90 commented 8 months ago

Fixes #1349.

This fixes a deprecation notice in PHP 8:

PHP Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in classes/class-log.php on line 217

The value of my exclude rule was:

Array
(
    [connector] =>
    [context] =>
    [action] =>
    [ip_address] => 127.0.0.1
    [author] =>
    [role] =>
)

The fix is to check for null first.

Checklist

Release Changelog

Release Checklist

Change [ ] to [x] to mark the items as done.