Make WordPress Core

Opened 3 months ago

Last modified 5 weeks ago

#61117 new defect (bug)

Guard condition in `delete_temp_backup()` shouldn't return early

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: 6.7 Priority: low
Severity: normal Version: 6.3
Component: Upgrade/Install Keywords: has-patch needs-testing
Focuses: Cc:

Description

In the delete_temp_backup() function there is a guard condition which triggers an early return if the arguments for any of the temp backups are empty (ref).

This prevents further iteration of the array of temp backups. In theory this prevents the deletion of a valid backup that exists in in a subsequent element in the array.

I think the return false should be replaced with continue.

Attachments (1)

patch.diff (480 bytes) - added by amitraj2203 3 months ago.
Patch file

Download all attachments as: .zip

Change History (7)

@amitraj2203
3 months ago

Patch file

#1 @amitraj2203
3 months ago

@johnbillion I have submitted the patch for the same.

#2 @SergeyBiryukov
3 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 6.6

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


6 weeks ago

#4 @jamieblomerus
6 weeks ago

During today's bug scrub, it was highlighted that the patch needs testing, and guidance was sought for from people who know more about this. The discussion focused on whether true or false should be returned when deletion is skipped, considering the potential impact on other parts of the code. It was noted that low-level APIs typically return true for successful deletion or when the item to be deleted does not exist.

Suggestions for handling broken backups included using unset(), adding an error, or utilizing wp_trigger_error() behind a WP_DEBUG flag.

We felt like a more extensive discussion is needed.

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


5 weeks ago

#6 @nhrrob
5 weeks ago

  • Keywords needs-testing added
  • Milestone changed from 6.6 to 6.7

We are very close to 6.6 RC1.
Punting to the next milestone.

Note: See TracTickets for help on using tickets.