Make WordPress Core


Ignore:
Timestamp:
05/13/2005 09:53:18 PM (21 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

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.