[wp-trac] [WordPress Trac] #56431: Fatal Error on Update Page When a Plugin's Icon is Not Set

WordPress Trac noreply at wordpress.org
Mon Aug 7 23:18:51 UTC 2023


#56431: Fatal Error on Update Page When a Plugin's Icon is Not Set
-------------------------------------------------+-------------------------
 Reporter:  scott.deluzio                        |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Upgrade/Install                      |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch needs-testing php8 dev-  |     Focuses:
  feedback reporter-feedback                     |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  needs-patch needs-testing php8 dev-feedback => needs-patch
     needs-testing php8 dev-feedback reporter-feedback


Comment:

 Hmm, I don't how / why the following code in `wp-admin/update-core.php`
 throws a fatal error:

 {{{#!php
 if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {
 }}}

 `empty()` is checking each part of the chain including that `icons` is an
 array and if it has `$preferred_icon`.

 I set up 4 scenarios https://3v4l.org/kAVJ9 to see this in action. It
 worked as expected, with no fatal errors.

 Hmm. What am I missing?

 Hey @scottdeluzio, do you have a backtrace available? It might provide
 more clues.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56431#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list