Fix the case-sensitivity of some HTTP class usage.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@34123 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-09-14 17:36:37 +00:00
parent 811e538325
commit 2c91a4d1e0
5 changed files with 26 additions and 22 deletions

View File

@@ -304,16 +304,20 @@ class WP_Http {
*
* @since 3.7.0
*
* @param array $value Array of HTTP transports to check. Default array contains
* 'curl', and 'streams', in that order.
* @param array $args HTTP request arguments.
* @param string $url The URL to request.
* @param array $transports Array of HTTP transports to check. Default array contains
* 'curl', and 'streams', in that order.
* @param array $args HTTP request arguments.
* @param string $url The URL to request.
*/
$request_order = apply_filters( 'http_api_transports', array( 'curl', 'streams' ), $args, $url );
$transports = array( 'curl', 'streams' );
$request_order = apply_filters( 'http_api_transports', $transports, $args, $url );
// Loop over each transport on each HTTP request looking for one which will serve this request's needs.
foreach ( $request_order as $transport ) {
$class = 'WP_HTTP_' . $transport;
if ( in_array( $transport, $transports ) ) {
$transport = ucfirst( $transport );
}
$class = 'WP_Http_' . $transport;
// Check to see if this transport is a possibility, calls the transport statically.
if ( !call_user_func( array( $class, 'test' ), $args, $url ) )
@@ -548,7 +552,7 @@ class WP_Http {
// Upgrade any name => value cookie pairs to WP_HTTP_Cookie instances.
foreach ( $r['cookies'] as $name => $value ) {
if ( ! is_object( $value ) )
$r['cookies'][ $name ] = new WP_HTTP_Cookie( array( 'name' => $name, 'value' => $value ) );
$r['cookies'][ $name ] = new WP_Http_Cookie( array( 'name' => $name, 'value' => $value ) );
}
$cookies_header = '';
@@ -736,11 +740,11 @@ class WP_Http {
if ( empty( $url ) )
return $maybe_relative_path;
if ( ! $url_parts = WP_HTTP::parse_url( $url ) ) {
if ( ! $url_parts = WP_Http::parse_url( $url ) ) {
return $maybe_relative_path;
}
if ( ! $relative_url_parts = WP_HTTP::parse_url( $maybe_relative_path ) ) {
if ( ! $relative_url_parts = WP_Http::parse_url( $maybe_relative_path ) ) {
return $maybe_relative_path;
}
@@ -824,7 +828,7 @@ class WP_Http {
if ( is_array( $redirect_location ) )
$redirect_location = array_pop( $redirect_location );
$redirect_location = WP_HTTP::make_absolute_url( $redirect_location, $url );
$redirect_location = WP_Http::make_absolute_url( $redirect_location, $url );
// POST requests should not POST to a redirected location.
if ( 'POST' == $args['method'] ) {