Changeset 4752 for trunk/wp-includes/functions.php
- Timestamp:
- 01/16/2007 06:41:05 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r4725 r4752 775 775 776 776 function wp_remote_fopen( $uri ) { 777 $timeout = 10; 778 $parsed_url = @parse_url($uri); 779 780 if ( !$parsed_url || !is_array($parsed_url) ) 781 return false; 782 783 if ( !isset($parsed_url['scheme']) || !in_array($parsed_url['scheme'], array('http','https')) ) 784 $uri = 'http://' . $uri; 785 777 786 if ( ini_get('allow_url_fopen') ) { 778 787 $fp = @fopen( $uri, 'r' ); 779 788 if ( !$fp ) 780 789 return false; 790 791 //stream_set_timeout($fp, $timeout); // Requires php 4.3 781 792 $linea = ''; 782 793 while( $remote_read = fread($fp, 4096) ) … … 789 800 curl_setopt ($handle, CURLOPT_CONNECTTIMEOUT, 1); 790 801 curl_setopt ($handle, CURLOPT_RETURNTRANSFER, 1); 802 curl_setopt ($handle, CURLOPT_TIMEOUT, $timeout); 791 803 $buffer = curl_exec($handle); 792 804 curl_close($handle);
Note: See TracChangeset
for help on using the changeset viewer.