PHP Warning: Trying to access array offset on value of type bool
-
I’m seeing these PHP warnings on an up-to-date WordPress installation running on PHP 8:
[Jun 03, 03:56:02] PHP Warning: Trying to access array offset on value of type bool in /wp-content/plugins/admin-custom-login/init.php on line 257
[Jun 03, 03:56:02] PHP Warning: Trying to access array offset on value of type bool in /wp-content/plugins/admin-custom-login/init.php on line 258that relates to this block of code:
<?php $g_page = unserialize(get_option('Admin_custome_login_gcaptcha')); $site_key = $g_page['site_key']; $secret_key = $g_page['secret_key']; ?>
I’m guessing that if the “Admin_custome_login_gcaptcha” option is not there, it returns a bool value of ‘false’ that is then trying to be accessed as an array. Perhaps an “if ( is_array( $g_page ) )” around the two assignments would avoid this.
I’m not seeing any user-facing problems due to this, so it’s not urgent. Just some housekeeping, perhaps.
Thanks for a great plugin!
- The topic ‘PHP Warning: Trying to access array offset on value of type bool’ is closed to new replies.