Ticket #29719: 29719.1.patch
File 29719.1.patch, 3.4 KB (added by , 10 years ago) |
---|
-
wp-includes/update.php
118 118 ); 119 119 120 120 $response = wp_remote_post( $url, $options ); 121 if ( $ssl && is_wp_error( $response ) ) {121 if ( ! $ssl && is_wp_error( $response ) ) { 122 122 trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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 ); 123 123 $response = wp_remote_post( $http_url, $options ); 124 124 } 125 125 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 126 131 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { 127 132 return; 128 133 } … … 298 303 $url = set_url_scheme( $url, 'https' ); 299 304 300 305 $raw_response = wp_remote_post( $url, $options ); 301 if ( $ssl && is_wp_error( $raw_response ) ) {306 if ( ! $ssl && is_wp_error( $raw_response ) ) { 302 307 trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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 ); 303 308 $raw_response = wp_remote_post( $http_url, $options ); 304 309 } 305 310 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 306 316 if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) { 307 317 return; 308 318 } … … 462 472 $url = set_url_scheme( $url, 'https' ); 463 473 464 474 $raw_response = wp_remote_post( $url, $options ); 465 if ( $ssl && is_wp_error( $raw_response ) ) {475 if ( ! $ssl && is_wp_error( $raw_response ) ) { 466 476 trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’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 ); 467 477 $raw_response = wp_remote_post( $http_url, $options ); 468 478 } 469 479 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 470 485 if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) { 471 486 return; 472 487 }