WordPress.org

Make WordPress Core

Ticket #29719: 29719.1.patch

File 29719.1.patch, 3.4 KB (added by grapplerulrich, 4 years ago)
  • wp-includes/update.php

     
    118118        );
    119119
    120120        $response = wp_remote_post( $url, $options );
    121         if ( $ssl && is_wp_error( $response ) ) {
     121        if ( ! $ssl && is_wp_error( $response ) ) {
    122122                trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
    123123                $response = wp_remote_post( $http_url, $options );
    124124        }
    125125
     126        if ( is_wp_error( $response ) ) {
     127                trigger_error( $response->get_error_message() . ' ' . __( 'If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     128                return;
     129        }
     130
    126131        if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
    127132                return;
    128133        }
     
    298303                $url = set_url_scheme( $url, 'https' );
    299304
    300305        $raw_response = wp_remote_post( $url, $options );
    301         if ( $ssl && is_wp_error( $raw_response ) ) {
     306        if ( ! $ssl && is_wp_error( $raw_response ) ) {
    302307                trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
    303308                $raw_response = wp_remote_post( $http_url, $options );
    304309        }
    305310
     311        if ( is_wp_error( $raw_response ) ) {
     312                trigger_error( $raw_response->get_error_message() . ' ' . __( 'If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     313                return;
     314        }
     315
    306316        if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
    307317                return;
    308318        }
     
    462472                $url = set_url_scheme( $url, 'https' );
    463473
    464474        $raw_response = wp_remote_post( $url, $options );
    465         if ( $ssl && is_wp_error( $raw_response ) ) {
     475        if ( ! $ssl && is_wp_error( $raw_response ) ) {
    466476                trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
    467477                $raw_response = wp_remote_post( $http_url, $options );
    468478        }
    469479
     480        if ( is_wp_error( $raw_response ) ) {
     481                trigger_error( $raw_response->get_error_message() . ' ' . __( 'If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
     482                return;
     483        }
     484
    470485        if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
    471486                return;
    472487        }