WordPress.org

Make WordPress Core

Opened 5 weeks ago

Closed 2 weeks ago

Last modified 2 weeks ago

#51400 closed defect (bug) (fixed)

Undefined index during automatic plugin/theme updates

Reported by: afragen Owned by: SergeyBiryukov
Milestone: 5.5.2 Priority: normal
Severity: normal Version: 5.5
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:

Description

When a site has only plugins or themes available for auto-updates the WP_Automatic_Updater::after_plugin_theme_update( $update_results ) may have an undefined value in the parameter $update_results. This will result in a PHP Notice for an undefined index of either 'plugin' or 'theme' in wp-admin/includes/class-wp-automatic-updater in the auto_{plugin|theme}_update_send_email filter hook.

To fix this, the missing index simply needs to be set.

Attachments (1)

51400.diff (689 bytes) - added by afragen 5 weeks ago.

Download all attachments as: .zip

Change History (8)

@afragen
5 weeks ago

#1 @audrasjb
5 weeks ago

  • Milestone changed from Awaiting Review to 5.5.2

Good catch @afragen

Indeed, this is a real issue. The patch looks good to me.
Let's move this to 5.5.2.

#2 @SergeyBiryukov
4 weeks ago

  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

This ticket was mentioned in Slack in #core by afragen. View the logs.


2 weeks ago

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


2 weeks ago

#5 @audrasjb
2 weeks ago

  • Keywords dev-feedback removed

As per @peterwilsoncc’s comment during today’s bug scrub, let's see if we can define each sub array while setting up rather than isset checks. Otherwise, the current patch is tested and works fine.

#6 @SergeyBiryukov
2 weeks ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49166:

Upgrade/Install: Check if plugin or theme update results are available before applying the notification filters.

This avoids a PHP notice for an undefined index of either plugin or theme in the auto_{plugin|theme}_update_send_email filter hook.

Props afragen, audrasjb.
Fixes #51400.

#7 @SergeyBiryukov
2 weeks ago

In 49167:

Upgrade/Install: Check if plugin or theme update results are available before applying the notification filters.

This avoids a PHP notice for an undefined index of either plugin or theme in the auto_{plugin|theme}_update_send_email filter hook.

Props afragen, audrasjb.
Merges [49166] to the 5.5 branch.
Fixes #51400.

Note: See TracTickets for help on using tickets.