stream
stream copied to clipboard
Adjust exclude rules filtering to avoid passing null to strlen() to fix PHP 8 deprecation notice
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
- [ ] Project documentation has been updated to reflect the changes in this pull request, if applicable.
- [ ] I have tested the changes in the local development environment (see
contributing.md
). - [ ] I have added phpunit tests.
Release Changelog
- Fix: Avoid deprecation notices in PHP 8.
Release Checklist
- [ ] This pull request is to the
master
branch. - [ ] Release version follows semantic versioning. Does it include breaking changes?
- [ ] Update changelog in
readme.txt
. - [ ] Bump version in
stream.php
. - [ ] Bump
Stable tag
inreadme.txt
. - [ ] Bump version in
classes/class-plugin.php
. - [ ] Draft a release on GitHub.
Change [ ]
to [x]
to mark the items as done.