Upgrade/Install: Fix broken sprintf() call when deleting a backup.

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.
Fixes #59320.

git-svn-id: https://develop.svn.wordpress.org/trunk@56550 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Colin Stewart
2023-09-10 07:31:47 +00:00
parent 54e1b4b959
commit 2a13d9321c

View File

@@ -1207,8 +1207,7 @@ class WP_Upgrader {
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;
}