From 86d28672fe4fd06956fbb9aacf31c18ac55d8064 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 29 Jun 2023 17:05:30 +0000 Subject: [PATCH] Filesystem API: Define password as `null` if not set when using SSH2 with public/private keys. This resolves an `Undefined array key "password"` PHP warning in `WP_Filesystem_SSH2::connect()` when using public/private key authentication, in which case providing a password is optional. Follow-up to [8865]. Props J-Dill, costdev, ehsanakhgari, dd32. Fixes #33196. Built from https://develop.svn.wordpress.org/trunk@56111 git-svn-id: http://core.svn.wordpress.org/trunk@55623 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-ssh2.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-wp-filesystem-ssh2.php b/wp-admin/includes/class-wp-filesystem-ssh2.php index 2b3edf1adc..d68f1433d1 100644 --- a/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -103,6 +103,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { // Password can be blank if we are using keys. if ( ! $this->keys ) { $this->errors->add( 'empty_password', __( 'SSH2 password is required' ) ); + } else { + $this->options['password'] = null; } } else { $this->options['password'] = $opt['password']; diff --git a/wp-includes/version.php b/wp-includes/version.php index 818edeac23..0efbc4d14a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-beta2-56110'; +$wp_version = '6.3-beta2-56111'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.