[wp-trac] [WordPress Trac] #51892: Fix core_update_footer() for new Updates API

WordPress Trac noreply at wordpress.org
Thu Dec 3 13:41:49 UTC 2020


#51892: Fix core_update_footer() for new Updates API
---------------------------------------+-----------------------------
 Reporter:  afragen                    |       Owner:  SergeyBiryukov
     Type:  defect (bug)               |      Status:  reopened
 Priority:  normal                     |   Milestone:  5.6
Component:  Upgrade/Install            |     Version:  5.6
 Severity:  normal                     |  Resolution:
 Keywords:  has-patch has-screenshots  |     Focuses:
---------------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 To summarize the Slack thread linked above, if
 `get_preferred_from_update_core()` gets an empty response from
 `get_core_updates()`, it returns an object with `'response' => 'latest'`
 and no other properties, so checking `$cur->version` without making sure
 it exists can cause a PHP warning.

 Checking `$wp_version` instead would be more consistent with
 `core_upgrade_preamble()`, see [49709] / #51822.

 Additionally, `$cur->url` is unused since [8595] and can be safely
 removed.

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


More information about the wp-trac mailing list