From d065eedd0d88215637f3468c49a76057f4ca731f Mon Sep 17 00:00:00 2001 From: Colin Stewart Date: Thu, 14 Sep 2023 10:41:24 +0000 Subject: [PATCH] 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. 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 --- src/wp-admin/includes/class-wp-upgrader.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php index a2cea37917..8458ac070b 100644 --- a/src/wp-admin/includes/class-wp-upgrader.php +++ b/src/wp-admin/includes/class-wp-upgrader.php @@ -1206,8 +1206,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; }