Changeset 41605
- Timestamp:
- 09/27/2017 07:59:14 AM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-community-events.php
r41316 r41605 93 93 } 94 94 95 $api_url = 'https://api.wordpress.org/events/1.0/'; 96 $request_args = $this->get_request_args( $location_search, $timezone ); 95 // include an unmodified $wp_version 96 include( ABSPATH . WPINC . '/version.php' ); 97 98 $api_url = 'http://api.wordpress.org/events/1.0/'; 99 $request_args = $this->get_request_args( $location_search, $timezone ); 100 $request_args['user-agent'] = 'WordPress/' . $wp_version . '; ' . home_url( '/' ); 101 102 if ( wp_http_supports( array( 'ssl' ) ) ) { 103 $api_url = set_url_scheme( $api_url, 'https' ); 104 } 105 97 106 $response = wp_remote_get( $api_url, $request_args ); 98 107 $response_code = wp_remote_retrieve_response_code( $response ); -
trunk/src/wp-admin/includes/credits.php
r38705 r41605 16 16 */ 17 17 function wp_credits() { 18 $wp_version = get_bloginfo( 'version' ); 18 // include an unmodified $wp_version 19 include( ABSPATH . WPINC . '/version.php' ); 20 19 21 $locale = get_user_locale(); 20 22 … … 25 27 || ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 ) 26 28 ) { 27 $response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version={$wp_version}&locale={$locale}" ); 29 $url = "http://api.wordpress.org/core/credits/1.1/?version={$wp_version}&locale={$locale}"; 30 $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) ); 31 32 if ( wp_http_supports( array( 'ssl' ) ) ) { 33 $url = set_url_scheme( $url, 'https' ); 34 } 35 36 $response = wp_remote_get( $url, $options ); 28 37 29 38 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) -
trunk/src/wp-admin/includes/dashboard.php
r41200 r41605 1510 1510 1511 1511 if ( false === ($response = get_site_transient('browser_' . $key) ) ) { 1512 // include an unmodified $wp_version 1513 include( ABSPATH . WPINC . '/version.php' ); 1514 1515 $url = 'http://api.wordpress.org/core/browse-happy/1.1/'; 1512 1516 $options = array( 1513 'body' 1514 'user-agent' => 'WordPress/' . get_bloginfo( 'version' ) . '; ' . home_url()1517 'body' => array( 'useragent' => $_SERVER['HTTP_USER_AGENT'] ), 1518 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) 1515 1519 ); 1516 1520 1517 $response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.1/', $options ); 1521 if ( wp_http_supports( array( 'ssl' ) ) ) { 1522 $url = set_url_scheme( $url, 'https' ); 1523 } 1524 1525 $response = wp_remote_post( $url, $options ); 1518 1526 1519 1527 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) -
trunk/src/wp-admin/includes/import.php
r38705 r41605 132 132 if ( ! $popular_importers ) { 133 133 $url = add_query_arg( array( 134 'locale' => get_user_locale(),134 'locale' => $locale, 135 135 'version' => $wp_version, 136 136 ), 'http://api.wordpress.org/core/importers/1.1/' ); 137 $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url() ); 137 $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) ); 138 139 if ( wp_http_supports( array( 'ssl' ) ) ) { 140 $url = set_url_scheme( $url, 'https' ); 141 } 142 138 143 $response = wp_remote_get( $url, $options ); 139 144 $popular_importers = json_decode( wp_remote_retrieve_body( $response ), true ); -
trunk/src/wp-admin/includes/plugin-install.php
r41289 r41605 142 142 143 143 if ( false === $res ) { 144 // include an unmodified $wp_version 145 include( ABSPATH . WPINC . '/version.php' ); 146 144 147 $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/'; 145 148 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) … … 148 151 $http_args = array( 149 152 'timeout' => 15, 153 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ), 150 154 'body' => array( 151 155 'action' => $action, -
trunk/src/wp-admin/includes/theme.php
r40313 r41605 449 449 450 450 if ( ! $res ) { 451 // include an unmodified $wp_version 452 include( ABSPATH . WPINC . '/version.php' ); 453 451 454 $url = $http_url = 'http://api.wordpress.org/themes/info/1.0/'; 452 455 if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) … … 454 457 455 458 $http_args = array( 459 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ), 456 460 'body' => array( 457 461 'action' => $action, -
trunk/src/wp-includes/update.php
r40575 r41605 302 302 'all' => wp_json_encode( true ), 303 303 ), 304 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )304 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) 305 305 ); 306 306 … … 480 480 'locale' => wp_json_encode( $locales ), 481 481 ), 482 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )482 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) 483 483 ); 484 484
Note: See TracChangeset
for help on using the changeset viewer.