Breaks with PHP 8
-
This plugin sometimes saves a
nullrecord toip_rangein thewp_uam_accessgroupstable. This is later passed to theexplodefunction inUserGroup.php. Passingnulltoexplodeis 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:99This can be corrected by changing line
UserGroup.php:134to$this->ipRange = $dbUserGroup->ip_range ?? '';. This ensures that when theUserGroupis loaded from the database theip_rangewill fallback to a string if the stored value isnull.
The topic ‘Breaks with PHP 8’ is closed to new replies.