File Editor: Don't verify SSL certificate when doing loopback requests for checking for fatal errors.

Props Clorith.
See #47957.
Built from https://develop.svn.wordpress.org/trunk@46230


git-svn-id: http://core.svn.wordpress.org/trunk@46042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2019-09-21 15:59:56 +00:00
parent c72a36596e
commit 4d9c482e79
2 changed files with 5 additions and 2 deletions

View File

@ -518,6 +518,9 @@ function wp_edit_theme_plugin_file( $args ) {
'Cache-Control' => 'no-cache', 'Cache-Control' => 'no-cache',
); );
/** This filter is documented in wp-includes/class-wp-http-streams.php */
$sslverify = apply_filters( 'https_local_ssl_verify', false );
// Include Basic auth in loopback requests. // Include Basic auth in loopback requests.
if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {
$headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); $headers['Authorization'] = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) );
@ -547,7 +550,7 @@ function wp_edit_theme_plugin_file( $args ) {
$url = admin_url(); $url = admin_url();
} }
$url = add_query_arg( $scrape_params, $url ); $url = add_query_arg( $scrape_params, $url );
$r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout' ) ); $r = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );
$body = wp_remote_retrieve_body( $r ); $body = wp_remote_retrieve_body( $r );
$scrape_result_position = strpos( $body, $needle_start ); $scrape_result_position = strpos( $body, $needle_start );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-alpha-46229'; $wp_version = '5.3-alpha-46230';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.