Closed adagio closed 6 years ago
@adagio Thanks for the heads up on this, we'll look into getting this fixed for the next release. It looks like switching the order of the statements is enough to fix the issue:
if ( 401 === (int) $response['response']['code'] ) {
$this->error = __( 'The remote site is protected with Basic Authentication. Please enter the username and password above to continue. (401 Unauthorized)', 'wp-migrate-db' );
$this->log_error( $this->error, $response );
return false;
} elseif ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) {
return $this->retry_remote_post( $url, $data, $scope, $args, $expecting_serial );
} ...
class/wpmdb-base.php
this case should match the elseif('401' .... but matches the if( 0 === strpos ...
} elseif ( 200 > (int) $response['response']['code'] || 399 < (int) $response['response']['code'] ) { if ( 0 === strpos( $url, 'https://' ) && 'ajax_verify_connection_to_remote_site' == $scope ) { return $this->retry_remote_post( $url, $data, $scope, $args, $expecting_serial ); } elseif ( '401' == $response['response']['code'] ) {