Skip to content
Permalink
Browse files

File Editor: Don't verify SSL certificate when doing loopback request…

…s for checking for fatal errors.

Props Clorith.
See #47957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46230 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
ocean90 committed Sep 21, 2019
1 parent cb076ca commit e6ea695f5a38196b83dd852c4b72b01676cd0583
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/wp-admin/includes/file.php
@@ -518,6 +518,9 @@ function wp_edit_theme_plugin_file( $args ) {
'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.
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'] ) );
@@ -547,7 +550,7 @@ function wp_edit_theme_plugin_file( $args ) {
$url = admin_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 );
$scrape_result_position = strpos( $body, $needle_start );

0 comments on commit e6ea695

Please sign in to comment.
You can’t perform that action at this time.