Skip to content
Snippets Groups Projects
Commit 726b4b33 authored by Nate Lampton's avatar Nate Lampton
Browse files

Issue #1795160 by elplatt and Demonick99: An HTTP error 0 occurred when transferring remote files.

parent 0979e04c
Branches 6.x-1.x
Tags 6.x-1.10
No related merge requests found
......@@ -131,6 +131,7 @@ function filefield_source_remote_value($element, &$item) {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, '_filefield_source_remote_parse_header');
// Causes a warning if PHP safe mode is on.
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
......@@ -138,7 +139,6 @@ function filefield_source_remote_value($element, &$item) {
$info = curl_getinfo($ch);
if ($info['http_code'] != 200) {
curl_setopt($ch, CURLOPT_HTTPGET, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$file_contents = curl_exec($ch);
$info = curl_getinfo($ch);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment