Opened 4 years ago
Closed 2 months ago
#57152 closed defect (bug) (duplicate)
Trying to access array offset on value of type bool (class-wp-recovery-mode-email-service.php)
| Reported by: | Mayhem30 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Site Health | Version: | 6.1.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
After editing my functions.php file, WordPress emailed me to let me know I made a mistake and there was an error.
When I checked the error log, I saw this :
[19-Nov-2022 03:14:01 UTC] PHP Parse error: Unclosed '{' does not match ')' in /wp-content/themes/wonder/functions.php on line 552
[19-Nov-2022 03:14:01 UTC] PHP Warning: Trying to access array offset on value of type bool in /wp-includes/class-wp-recovery-mode-email-service.php on line 372
[19-Nov-2022 03:14:01 UTC] PHP Warning: Trying to access array offset on value of type bool in /wp-includes/class-wp-recovery-mode-email-service.php on line 373
The warnings are coming from $plugin[name] and [version] lines:
if ( null !== $plugin ) { $debug['plugin'] = sprintf( /* translators: 1: The failing plugins name. 2: The failing plugins version. */ __( 'Current plugin: %1$s (version %2$s)' ), $plugin['Name'], $plugin['Version'] ); }
The failure was not from a plugin, but from my functions file.
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the report!
#62816 updated the condition to make sure
$pluginis an array, preventing warnings about it being boolean (false).