Make WordPress Core


Ignore:
Timestamp:
06/29/2023 05:03:19 PM (16 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php

    r55714 r56111  
    104104            if ( ! $this->keys ) {
    105105                $this->errors->add( 'empty_password', __( 'SSH2 password is required' ) );
     106            } else {
     107                $this->options['password'] = null;
    106108            }
    107109        } else {
Note: See TracChangeset for help on using the changeset viewer.