WordPress.org

Make WordPress Core

Changeset 8586


Ignore:
Timestamp:
08/08/08 00:02:11 (7 years ago)
Author:
ryan
Message:

Fix issues with fsockopen transport. Props santosj. see #4779

File:
1 edited

Legend:

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

    r8584 r8586  
    126126            if ( true === WP_Http_ExtHttp::test() && apply_filters('use_http_extension_transport', true) ) 
    127127                $working_transport[] = new WP_Http_ExtHttp(); 
     128            else if ( true === WP_Http_Fsockopen::test() && apply_filters('use_fsockopen_transport', true) ) 
     129                $working_transport[] = new WP_Http_Fsockopen(); 
    128130            else if ( true === WP_Http_Streams::test() && apply_filters('use_streams_transport', true) ) 
    129131                $working_transport[] = new WP_Http_Streams(); 
    130             else if ( true === WP_Http_Fsockopen::test() && apply_filters('use_fsockopen_transport', true) ) 
    131                 $working_transport[] = new WP_Http_Fsockopen(); 
    132132        } 
    133133 
     
    196196        } 
    197197 
    198         if ( ! isset($headers['user-agent']) || ! isset($headers['User-Agent']) ) 
     198        if ( isset($headers['User-Agent']) ) { 
     199            $headers['user-agent'] = $headers['User-Agent']; 
     200            unset($headers['User-Agent']); 
     201        } 
     202 
     203        if ( ! isset($headers['user-agent']) ) 
    199204            $headers['user-agent'] = $r['user-agent']; 
    200205 
     
    442447        $strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n"; 
    443448 
    444         if ( is_array($header) ) { 
    445             foreach ( (array) $this->getHeaders() as $header => $headerValue ) 
     449        if ( is_array($headers) ) { 
     450            foreach ( (array) $headers as $header => $headerValue ) 
    446451                $strHeaders .= $header . ': ' . $headerValue . "\r\n"; 
    447452        } else { 
    448             $strHeaders .= $header; 
     453            $strHeaders .= $headers; 
    449454        } 
    450455 
Note: See TracChangeset for help on using the changeset viewer.