lichengdong / timthumb

Automatically exported from code.google.com/p/timthumb
1 stars 0 forks source link

CURL? #260

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I am not a programmer and am having issues with timthumb not showing my 
thumbs on my WordPress site. The hosting comp say that CURL would solve the 
issue If I replace the following code.

Have had a look at timbthumb.php and cant find where to replace? Does anyone 
have an idea or any other ideas!? 

Thanks,

JM

Replace: 
if(($hand=fopen($url,"r"))==false)
{$errmsg="Not a Valid Web site " . $url; break; }

with:

$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
if( ! curl_exec($ch)){ $errmsg="Not a Valid Web site " . $url;
break;
}
curl_close($ch);

Original issue reported on code.google.com by ja...@bestillbrand.com on 7 Sep 2011 at 8:35

GoogleCodeExporter commented 9 years ago
Hi - this code does not exist in TimThumb so I think you will need to go back 
to your host and ask them for more info. For reference, TimThumb already uses 
curl for accessing external data.

Original comment by BinaryMoon on 12 Oct 2011 at 8:32