[wp-trac] [WordPress Trac] #62816: Trying to access array offset on false in /{PATH}/wp-includes/class-wp-recovery-mode-email-service.php on line 367

WordPress Trac noreply at wordpress.org
Thu Jan 16 19:06:41 UTC 2025


#62816: Trying to access array offset on false in /{PATH}/wp-includes/class-wp-
recovery-mode-email-service.php on line 367
--------------------------+-----------------------------
 Reporter:  afwebdev      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In wp-includes/class-wp-recovery-mode-email-service.php on line 344, is
 this:

 {{{
 $plugin = $this->get_plugin( $extension );
 }}}

 however **WP_Recovery_Mode_Email_Service::get_plugin()** can return
 **false**, and when that happens the check **null !== $plugin** on line
 363 passes, but then
 {{{
 $debug['plugin']
 }}}
 on line 364 causes the following error:

 {{{
 PHP Warning:  Trying to access array offset on false in /{PATH}/wp-
 includes/class-wp-recovery-mode-email-service.php on line 367
 }}}

 The solution is to change line 363 to:

 {{{
 if ( is_array( $plugin ) ) {
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62816>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list