Make WordPress Core

Changeset 8522


Ignore:
Timestamp:
08/01/2008 09:24:03 PM (15 years ago)
Author:
ryan
Message:

Various http fixes from santosj. see #4779

File:
1 edited

Legend:

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

    r8520 r8522  
    537537            $url = str_replace($arrURL['scheme'], 'http', $url);
    538538
    539         $handle = fopen($url, 'rb');
     539        $handle = fopen($url, 'r');
    540540
    541541        if (! $handle)
     
    553553        while ( ! feof($handle) )
    554554            $strResponse .= fread($handle, 4096);
    555 
    556         fclose($handle);
    557555
    558556        $theHeaders = '';
     
    565563        $processedHeaders = WP_Http::processHeaders($theHeaders);
    566564
     565        fclose($handle);
    567566        return array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response']);
    568567    }
     
    636635        $context = stream_context_create($arrContext);
    637636
    638         $handle = fopen($url, 'rb', false, $context);
    639 
    640         stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $this->timeout) );
     637        $handle = fopen($url, 'r', false, $context);
     638
     639        stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $r['timeout']) );
    641640
    642641        if ( ! $handle)
     
    748747            'connecttimeout' => $r['timeout'],
    749748            'redirect' => $r['redirection'],
    750             'useragent' => $r['user_agent'],
     749            'useragent' => $r['user-agent'],
    751750            'headers' => $headers,
    752751        );
     
    850849
    851850        if ( $r['httpversion'] == '1.0' )
    852             curl_setopt( $headle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
     851            curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
    853852        else
    854             curl_setopt( $headle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
     853            curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
    855854
    856855        if ( ! $r['blocking'] ) {
Note: See TracChangeset for help on using the changeset viewer.