Posted by mohawke on September 16, 2005 at 2:38am
Jump to:
| Project: | Currency Exchange |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
My host has disabled fopen($url) for security reasons so I edited the code and used curl. I think an option to use curl over fopen would be a good idea.
Here is the code change snippet:
$curl_handle = curl_init();
curl_setopt ($curl_handle, CURLOPT_URL, $url);
curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl_handle, CURLOPT_CONNECTTIMEOUT, 20);
$handle = curl_exec($curl_handle);
if ($handle)
{
if ($record = $handle)
{
curl_close($curl_handle);
$currency_data = explode(',', $record);
Comments
#1
Can you do these things:
1. Submit it as a patch. See here for details http://drupal.org/patch
2. Make sure that the use of an external program (e.g. curl) does not introduce exploits. Since they are called using exec, they can be a security risk, and extreme care must be taken.
Thanks for bringing this up, it may help others who are in a similar situation.
#2
I don't think this version is maintained anymore but this bug is fixed in the 6.x branch by using drupal_http_request().