Make WordPress Core

Changeset 2606


Ignore:
Timestamp:
05/13/2005 09:53:18 PM (20 years ago)
Author:
matt
Message:

fclose removed, only use curl if we have to - http://mosquito.wordpress.org/view.php?id=1324 - hat tip: rboren

Location:
trunk
Files:
2 edited

Legend:

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

    r2581 r2606  
    18601860
    18611861function wp_remote_fopen( $uri ) {
    1862     if ( function_exists('curl_init') ) {
     1862    if ( ini_get('allow_url_fopen') ) {
     1863        $fp = fopen( $uri, 'r' );
     1864        if ( !$fp )
     1865            return false;
     1866        $linea = '';
     1867        while( $remote_read = fread($fp, 4096) )
     1868            $linea .= $remote_read;
     1869        fclose($fp);
     1870        return $linea;     
     1871    } else if ( function_exists('curl_init') ) {
    18631872        $handle = curl_init();
    18641873        curl_setopt ($handle, CURLOPT_URL, $uri);
     
    18691878        return $buffer;
    18701879    } else {
    1871         $fp = fopen( $uri, 'r' );
    1872         if ( !$fp )
    1873             return false;
    1874         $linea = '';
    1875         while( $remote_read = fread($fp, 4096) )
    1876             $linea .= $remote_read;
    1877         return $linea;
     1880        return false;
    18781881    }   
    18791882}
  • trunk/xmlrpc.php

    r2581 r2606  
    11861186            $context = str_replace('&', '&', $context);
    11871187        }
    1188                    
    1189         fclose($fp);
    11901188
    11911189        if (empty($context)) {
Note: See TracChangeset for help on using the changeset viewer.