[wp-trac] [WordPress Trac] #56431: Fatal Error on Update Page When a Plugin's Icon is Not Set
WordPress Trac
noreply at wordpress.org
Wed Aug 24 17:04:02 UTC 2022
#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: Plugins | Version: 6.0.1
Severity: normal | Keywords: needs-patch
Focuses: |
---------------------------+-----------------------------
When on the Dashboard > Updates page, if there is a plugin whose icon is
not set, a fatal error is generated, and no plugins are listed in the
update section.
`PHP Fatal error: Uncaught Error: Cannot use object of type stdClass as
array in /wp-admin/update-core.php:509`
I have often seen this with plugins that are not hosted on wordpress.org.
Mostly this is when you have a paid plugin that doesn't have an icon set.
I think the fix should be as follows:
`wp-admin/update-core.php` line 509:
`if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {`
should change to:
`if ( is_array( $plugin_data->update->icons ) && ! empty(
$plugin_data->update->icons[ $preferred_icon ] ) ) {`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56431>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list