Changeset 4827
- Timestamp:
- 01/28/2007 10:31:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-includes/functions.php
r4777 r4827 2188 2188 2189 2189 function wp_remote_fopen( $uri ) { 2190 $timeout = 10; 2191 $parsed_url = @parse_url($uri); 2192 2193 if ( !$parsed_url || !is_array($parsed_url) ) 2194 return false; 2195 2196 if ( !isset($parsed_url['scheme']) || !in_array($parsed_url['scheme'], array('http','https')) ) 2197 $uri = 'http://' . $uri; 2198 2190 2199 if ( ini_get('allow_url_fopen') ) { 2191 2200 $fp = @fopen( $uri, 'r' ); 2192 2201 if ( !$fp ) 2193 2202 return false; 2203 2204 //stream_set_timeout($fp, $timeout); // Requires php 4.3 2194 2205 $linea = ''; 2195 2206 while( $remote_read = fread($fp, 4096) ) … … 2202 2213 curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 1); 2203 2214 curl_setopt ($handle, CURLOPT_RETURNTRANSFER, 1); 2215 curl_setopt ($handle, CURLOPT_TIMEOUT, $timeout); 2204 2216 $buffer = curl_exec($handle); 2205 2217 curl_close($handle);
Note: See TracChangeset
for help on using the changeset viewer.