Make WordPress Core

Opened 7 weeks ago

Last modified 5 weeks ago

#61116 new defect (bug)

Return value of `_wp_delete_all_temp_backups()` isn't used

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


The _wp_delete_all_temp_backups() function returns a WP_Error object when there's a failure condition, but this function is only used as a cron event callback function so the return value is not used anywhere.

As core has no error handling for cron events, I recommend triggering an error for these conditions (probably via wp_trigger_error()) and then doing early returns so the function returns void.

Attachments (1)

patch.diff (987 bytes) - added by amitraj2203 6 weeks ago.
Patch file.

Download all attachments as: .zip

Change History (4)

#1 @johnbillion
7 weeks ago

Correction: This function is used as a shutdown action callback (ref), not a cron event callback. Same problem though.

6 weeks ago

Patch file.

#2 @amitraj2203
6 weeks ago

Hi @johnbillion I have submitted the patch for the same.

This ticket was mentioned in PR #6565 on WordPress/wordpress-develop by @narenin.

5 weeks ago

  • Keywords has-patch added; needs-patch removed
Note: See TracTickets for help on using tickets.