Not a bug, but another way

mohawke - September 16, 2005 - 02:38
Project:Currency Exchange
Version:4.6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

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);

#1

kbahey - September 16, 2005 - 02:57

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.

 
 

Drupal is a registered trademark of Dries Buytaert.