Skip to content

Commit

Permalink
Upgrade/Install: Fix broken sprintf() call when deleting a backup.
Browse files Browse the repository at this point in the history
In `WP_Upgrader::delete_temp_backup()`, a malformed `sprintf()` call did not pass the value, triggering a Warning in PHP 7 and a Fatal Error in PHP 8.

This fixes the malformed `sprintf()` call by correctly passing the value.

Follow-up to [55720].

Props akihiroharai, afragen.
Merges [56550] to the 6.3 branch.
Fixes #59320.

git-svn-id: https://develop.svn.wordpress.org/branches/6.3@56582 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
costdev committed Sep 14, 2023
1 parent 3f295eb commit d065eed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/wp-admin/includes/class-wp-upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1206,8 +1206,7 @@ public function delete_temp_backup() {
if ( ! $wp_filesystem->delete( $temp_backup_dir, true ) ) {
$errors->add(
'temp_backup_delete_failed',
sprintf( $this->strings['temp_backup_delete_failed'] ),
$args['slug']
sprintf( $this->strings['temp_backup_delete_failed'], $args['slug'] )
);
continue;
}
Expand Down

0 comments on commit d065eed

Please sign in to comment.