[eluser]polyvoid[/eluser]
Hi ainstushar,
I've tried your 3 suggestions but I had no luck...
I've looking a bit further into this and so far I changed this:
line 822: $file_data .= file_get_contents( $r ) ."\n";
is now this:
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $r);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_data = curl_exec($ch);
curl_close($ch);
log_message('debug', 'TEST line 822: '.$r);
and line 851: $contents = file_get_contents( $ref );
is now this:
$ch = curl_init();
$timeout = 5;
curl_setopt ($ch, CURLOPT_URL, $ref);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$contents = curl_exec($ch);
curl_close($ch);
log_message('debug', 'TEST line 851: '.$ref);
This now works with files coming from another domain, but it no longer works with local files. Is someone more familiar with the curl function, and sees what I'm doing wrong?
Thanks in advance for your help!
-- edit --
After thinking more over this, I think the better solution is to build in an IF-statement, and use the curl function only when the requested file is an URL. If it isn't, it should come from the file system (unnecessary http-request is avoided as well) with the file_get_contents function.
I'll look into this a bit further tomorrow if I find some time.
OR if you find it sooner, or have another solution, don't hold back ;-)