--- flickr.module 2006-07-30 14:22:00.000000000 -0700 +++ flickr.module.curl 2006-07-30 14:27:28.000000000 -0700 @@ -177,14 +177,15 @@ function flickr_get_cached_file_contents // do nothing. XXX: Add stats code here. } else { - $f = fopen($file,"r"); - $f2 = fopen($cache_filename,"w+"); - while ($r = fread($f,8192)) - { - fwrite($f2,$r); - } - fclose($f2); - fclose($f); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $file); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + $file_contents = curl_exec($ch); + curl_close($ch); + + $fh = fopen($cache_filename, 'w+'); + fwrite($fh, $file_contents); + fclose($fh); } return file_get_contents ($cache_filename); // Return the file contents from the cache }