Hard crash in PHP 8 due to undefined “constant”
-
In bp-groupblog.php the following code causes a hard crash in PHP 8:
case 'Site name must be at least 4 characters.': if( strlen( $result['blogname'] ) < $checks[minlength] && !is_super_admin() ) $newerrors->add('blogname', __("Blog name must be at least " . $checks[minlength] . " characters", 'groupblog')); break;
This is due to ‘minlength’ being treated as an undefined constant. In PHP 8 undefined constants now result in an error (https://github.com/php/php-src/blob/4c0c7f1fd8fc4270703d0badff151115fda9f015/UPGRADING#L35). Here, $checks[minlength] was presumably meant to be $checks[‘minlength’]…
- The topic ‘Hard crash in PHP 8 due to undefined “constant”’ is closed to new replies.