Commit 594c113c authored by Bas de Nooijer's avatar Bas de Nooijer

Updated curl adapter file handling to prevent warnings in php >=5.5.0

parent 2e8e2eaa
......@@ -179,8 +179,14 @@ class Curl extends Configurable implements AdapterInterface
if ($method == Request::METHOD_POST) {
curl_setopt($handler, CURLOPT_POST, true);
if ($request->getFileUpload()) {
curl_setopt($handler, CURLOPT_POSTFIELDS, array('content' => '@'.$request->getFileUpload()));
if (version_compare(PHP_VERSION, '5.5.0') >= 0) {
$curlFile = curl_file_create($request->getFileUpload());
curl_setopt($handler, CURLOPT_POSTFIELDS, array('content', $curlFile));
} else {
curl_setopt($handler, CURLOPT_POSTFIELDS, array('content' => '@'.$request->getFileUpload()));
}
} else {
curl_setopt($handler, CURLOPT_POSTFIELDS, $request->getRawData());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment