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/src/wp-admin/includes/class-wp-filesystem-ssh2.php
+++ b/src/wp-admin/includes/class-wp-filesystem-ssh2.php
@@ -69,17 +69,6 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
 			$this->errors->add( 'no_ssh2_ext', __( 'The ssh2 PHP extension is not available' ) );
 			return;
 		}
-		if ( ! function_exists( 'stream_get_contents' ) ) {
-			$this->errors->add(
-				'ssh2_php_requirement',
-				sprintf(
-					/* translators: %s: stream_get_contents() */
-					__( 'The ssh2 PHP extension is available, however, we require the PHP5 function %s' ),
-					'<code>stream_get_contents()</code>'
-				)
-			);
-			return;
-		}
 
 		// Set defaults:
 		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/src/wp-admin/includes/file.php
+++ b/src/wp-admin/includes/file.php
@@ -1944,7 +1944,7 @@ function get_filesystem_method( $args = array(), $context = '', $allow_relaxed_f
 		}
 	}
 
-	if ( ! $method && isset( $args['connection_type'] ) && 'ssh' == $args['connection_type'] && extension_loaded( 'ssh2' ) && function_exists( 'stream_get_contents' ) ) {
+	if ( ! $method && isset( $args['connection_type'] ) && 'ssh' == $args['connection_type'] && extension_loaded( 'ssh2' ) ) {
 		$method = 'ssh2';
 	}
 	if ( ! $method && extension_loaded( 'ftp' ) ) {
@@ -2125,7 +2125,7 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
 	if ( extension_loaded( 'ftp' ) ) { //Only this supports FTPS
 		$types['ftps'] = __( 'FTPS (SSL)' );
 	}
-	if ( extension_loaded( 'ssh2' ) && function_exists( 'stream_get_contents' ) ) {
+	if ( extension_loaded( 'ssh2' ) ) {
 		$types['ssh'] = __( 'SSH2' );
 	}
 
-- 
2.23.0.windows.1

