From d8ef681e4db1b1e15fe3401ee5f1a82625da0df9 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Sat, 27 Jul 2019 04:30:38 +0200
Subject: [PATCH] [src] Remove work-arounds for stream_get_contents()
---
src/wp-admin/includes/class-wp-filesystem-ssh2.php | 11 -----------
src/wp-admin/includes/file.php | 4 ++--
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/src/wp-admin/includes/class-wp-filesystem-ssh2.php b/src/wp-admin/includes/class-wp-filesystem-ssh2.php
index cea45f1273..ccbabb0811 100644
a
|
b
|
class WP_Filesystem_SSH2 extends WP_Filesystem_Base { |
69 | 69 | $this->errors->add( 'no_ssh2_ext', __( 'The ssh2 PHP extension is not available' ) ); |
70 | 70 | return; |
71 | 71 | } |
72 | | if ( ! function_exists( 'stream_get_contents' ) ) { |
73 | | $this->errors->add( |
74 | | 'ssh2_php_requirement', |
75 | | sprintf( |
76 | | /* translators: %s: stream_get_contents() */ |
77 | | __( 'The ssh2 PHP extension is available, however, we require the PHP5 function %s' ), |
78 | | '<code>stream_get_contents()</code>' |
79 | | ) |
80 | | ); |
81 | | return; |
82 | | } |
83 | 72 | |
84 | 73 | // Set defaults: |
85 | 74 | if ( empty( $opt['port'] ) ) { |
diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 9d5244202e..8315e73f1b 100644
a
|
b
|
function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_f |
1944 | 1944 | } |
1945 | 1945 | } |
1946 | 1946 | |
1947 | | if ( ! $method && isset( $args['connection_type'] ) && 'ssh' == $args['connection_type'] && extension_loaded( 'ssh2' ) && function_exists( 'stream_get_contents' ) ) { |
| 1947 | if ( ! $method && isset( $args['connection_type'] ) && 'ssh' == $args['connection_type'] && extension_loaded( 'ssh2' ) ) { |
1948 | 1948 | $method = 'ssh2'; |
1949 | 1949 | } |
1950 | 1950 | if ( ! $method && extension_loaded( 'ftp' ) ) { |
… |
… |
function request_filesystem_credentials( $form_post, $type = '', $error = false, |
2125 | 2125 | if ( extension_loaded( 'ftp' ) ) { //Only this supports FTPS |
2126 | 2126 | $types['ftps'] = __( 'FTPS (SSL)' ); |
2127 | 2127 | } |
2128 | | if ( extension_loaded( 'ssh2' ) && function_exists( 'stream_get_contents' ) ) { |
| 2128 | if ( extension_loaded( 'ssh2' ) ) { |
2129 | 2129 | $types['ssh'] = __( 'SSH2' ); |
2130 | 2130 | } |
2131 | 2131 | |