Make WordPress Core

Changeset 17535


Ignore:
Timestamp:
03/23/2011 11:58:09 AM (15 years ago)
Author:
dd32
Message:

Prune PHP5 compat checks in WP_Http, WP_Http_Curl & WP_Http_Streams. Only removes pre PHP 5.2.4 conditional code. See #13915

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-http.php

    r17534 r17535  
    289289                } else {
    290290                        if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {
    291                                 if ( ! version_compare(phpversion(), '5.1.2', '>=') )
    292                                         $r['body'] = _http_build_query( $r['body'], null, '&' );
    293                                 else
    294                                         $r['body'] = http_build_query( $r['body'], null, '&' );
     291                                $r['body'] = http_build_query( $r['body'], null, '&' );
    295292                                $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' );
    296293                                $r['headers']['Content-Length'] = strlen( $r['body'] );
     
    955952                        return false;
    956953
    957                 if ( version_compare(PHP_VERSION, '5.0', '<') )
    958                         return false;
    959 
    960                 //HTTPS via Proxy was added in 5.1.0
    961                 $is_ssl = isset($args['ssl']) && $args['ssl'];
    962                 if ( $is_ssl && version_compare(PHP_VERSION, '5.1.0', '<') ) {
    963                         $proxy = new WP_HTTP_Proxy();
    964                         /**
    965                          * No URL check, as its not currently passed to the ::test() function
    966                          * In the case where a Proxy is in use, Just bypass this transport for HTTPS.
    967                          */
    968                         if ( $proxy->is_enabled() )
    969                                 return false;
    970                 }
    971 
    972954                return apply_filters('use_streams_transport', true, $args);
    973955        }
     
    11761158                if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
    11771159
    1178                         $isPHP5 = version_compare(PHP_VERSION, '5.0.0', '>=');
    1179 
    1180                         if ( $isPHP5 ) {
    1181                                 curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
    1182                                 curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() );
    1183                                 curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() );
    1184                         } else {
    1185                                 curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() .':'. $proxy->port() );
    1186                         }
     1160                        curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
     1161                        curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() );
     1162                        curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() );
    11871163
    11881164                        if ( $proxy->use_authentication() ) {
    1189                                 if ( $isPHP5 )
    1190                                         curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY );
    1191 
     1165                                curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY );
    11921166                                curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() );
    11931167                        }
Note: See TracChangeset for help on using the changeset viewer.