Breaks with PHP 8
-
This plugin sometimes saves a
null
record toip_range
in thewp_uam_accessgroups
table. This is later passed to theexplode
function inUserGroup.php
. Passingnull
toexplode
is a fatal error in PHP 8 and it renders the site unusable until the record in the DB is corrected.Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, null given in /var/www/public/wp-content/plugins/user-access-manager/src/UserGroup/UserGroup.php:99
This can be corrected by changing line
UserGroup.php:134
to$this->ipRange = $dbUserGroup->ip_range ?? '';
. This ensures that when theUserGroup
is loaded from the database theip_range
will fallback to a string if the stored value isnull
.
- The topic ‘Breaks with PHP 8’ is closed to new replies.