Changeset 34123
- Timestamp:
- 09/14/2015 05:36:37 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-http.php
r33880 r34123 305 305 * @since 3.7.0 306 306 * 307 * @param array $ valueArray of HTTP transports to check. Default array contains308 * 'curl', and 'streams', in that order.309 * @param array $args HTTP request arguments.310 * @param string $url The URL to request.307 * @param array $transports Array of HTTP transports to check. Default array contains 308 * 'curl', and 'streams', in that order. 309 * @param array $args HTTP request arguments. 310 * @param string $url The URL to request. 311 311 */ 312 $request_order = apply_filters( 'http_api_transports', array( 'curl', 'streams' ), $args, $url ); 312 $transports = array( 'curl', 'streams' ); 313 $request_order = apply_filters( 'http_api_transports', $transports, $args, $url ); 313 314 314 315 // Loop over each transport on each HTTP request looking for one which will serve this request's needs. 315 316 foreach ( $request_order as $transport ) { 316 $class = 'WP_HTTP_' . $transport; 317 if ( in_array( $transport, $transports ) ) { 318 $transport = ucfirst( $transport ); 319 } 320 $class = 'WP_Http_' . $transport; 317 321 318 322 // Check to see if this transport is a possibility, calls the transport statically. … … 549 553 foreach ( $r['cookies'] as $name => $value ) { 550 554 if ( ! is_object( $value ) ) 551 $r['cookies'][ $name ] = new WP_H TTP_Cookie( array( 'name' => $name, 'value' => $value ) );555 $r['cookies'][ $name ] = new WP_Http_Cookie( array( 'name' => $name, 'value' => $value ) ); 552 556 } 553 557 … … 737 741 return $maybe_relative_path; 738 742 739 if ( ! $url_parts = WP_H TTP::parse_url( $url ) ) {743 if ( ! $url_parts = WP_Http::parse_url( $url ) ) { 740 744 return $maybe_relative_path; 741 745 } 742 746 743 if ( ! $relative_url_parts = WP_H TTP::parse_url( $maybe_relative_path ) ) {747 if ( ! $relative_url_parts = WP_Http::parse_url( $maybe_relative_path ) ) { 744 748 return $maybe_relative_path; 745 749 } … … 825 829 $redirect_location = array_pop( $redirect_location ); 826 830 827 $redirect_location = WP_H TTP::make_absolute_url( $redirect_location, $url );831 $redirect_location = WP_Http::make_absolute_url( $redirect_location, $url ); 828 832 829 833 // POST requests should not POST to a redirected location. -
trunk/src/wp-includes/class-wp-http-streams.php
r33878 r34123 295 295 296 296 // Handle redirects. 297 if ( false !== ( $redirect_response = WP_H TTP::handle_redirects( $url, $r, $response ) ) )297 if ( false !== ( $redirect_response = WP_Http::handle_redirects( $url, $r, $response ) ) ) 298 298 return $redirect_response; 299 299 … … 344 344 * in the cert (if they exist) 345 345 */ 346 $host_type = ( WP_H TTP::is_ip_address( $host ) ? 'ip' : 'dns' );346 $host_type = ( WP_Http::is_ip_address( $host ) ? 'ip' : 'dns' ); 347 347 348 348 $certificate_hostnames = array(); -
trunk/src/wp-includes/formatting.php
r33955 r34123 3998 3998 ( preg_match( '#^(\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols() ) ? 3999 3999 $m[3] : 4000 WP_H TTP::make_absolute_url( $m[3], $_links_add_base )4000 WP_Http::make_absolute_url( $m[3], $_links_add_base ) 4001 4001 ) 4002 4002 . $m[2]; -
trunk/tests/phpunit/tests/http/base.php
r32712 r34123 17 17 function setUp() { 18 18 19 if ( is_callable( array('WP_H TTP', '_getTransport') ) ) {20 $this->markTestSkipped('The WP_H TTPtests require a class-http.php file of r17550 or later.');19 if ( is_callable( array('WP_Http', '_getTransport') ) ) { 20 $this->markTestSkipped('The WP_Http tests require a class-http.php file of r17550 or later.'); 21 21 return; 22 22 } 23 23 24 $class = "WP_H TTP_" . $this->transport;24 $class = "WP_Http_" . $this->transport; 25 25 if ( !call_user_func( array($class, 'test') ) ) { 26 26 $this->markTestSkipped( sprintf('The transport %s is not supported on this system', $this->transport) ); … … 185 185 $res = wp_remote_request( $url, array( 'stream' => true, 'timeout' => 30 ) ); //Auto generate the filename. 186 186 187 // Cleanup before we assert, as it'll return early. 187 // Cleanup before we assert, as it'll return early. 188 188 if ( ! is_wp_error( $res ) ) { 189 189 $filesize = filesize( $res['filename'] ); … … 206 206 $res = wp_remote_request( $url, array( 'stream' => true, 'timeout' => 30, 'limit_response_size' => $size ) ); //Auto generate the filename. 207 207 208 // Cleanup before we assert, as it'll return early. 208 // Cleanup before we assert, as it'll return early. 209 209 if ( ! is_wp_error( $res ) ) { 210 210 $filesize = filesize( $res['filename'] ); -
trunk/tests/phpunit/tests/http/http.php
r29864 r34123 11 11 */ 12 12 function test_make_absolute_url( $relative_url, $absolute_url, $expected ) { 13 if ( ! is_callable( array( 'WP_H TTP', 'make_absolute_url' ) ) ) {13 if ( ! is_callable( array( 'WP_Http', 'make_absolute_url' ) ) ) { 14 14 $this->markTestSkipped( "This version of WP_HTTP doesn't support WP_HTTP::make_absolute_url()" ); 15 15 return; 16 16 } 17 17 18 $actual = WP_H TTP::make_absolute_url( $relative_url, $absolute_url );18 $actual = WP_Http::make_absolute_url( $relative_url, $absolute_url ); 19 19 $this->assertEquals( $expected, $actual ); 20 20 } … … 106 106 107 107 /** 108 * A Wrapper of WP_H TTPto make parse_url() publicaly accessible for testing purposes.108 * A Wrapper of WP_Http to make parse_url() publicaly accessible for testing purposes. 109 109 */ 110 class WP_HTTP_Testable extends WP_H TTP{110 class WP_HTTP_Testable extends WP_Http { 111 111 public static function parse_url( $url ) { 112 112 return parent::parse_url( $url );
Note: See TracChangeset
for help on using the changeset viewer.