Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#51400 closed defect (bug) (fixed)

Undefined index during automatic plugin/theme updates

Reported by: afragen's profile afragen Owned by: sergeybiryukov's profile 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 4 years ago.

Download all attachments as: .zip

Change History (8)

@afragen
4 years ago

#1 @audrasjb
4 years 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 years ago

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

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


4 years ago

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


4 years ago

#5 @audrasjb
4 years 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
4 years 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
4 years 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.