From d0bcc53cd9fafb2f2a10ecbdea1ee6695ee460d3 Mon Sep 17 00:00:00 2001 From: Jonathan Vanherpe Date: Tue, 8 Sep 2015 11:44:42 +1000 Subject: [PATCH] Fix bug that caused plugin to stop working in php 5.6 , borrowed from https://github.com/xgin/Dropbox/commit/1978b382f335df71a414b34eb81e0da198fd4157 --- Dropbox/OAuth/Consumer/Curl.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Dropbox/OAuth/Consumer/Curl.php b/Dropbox/OAuth/Consumer/Curl.php index 28d9dc2..ba52e44 100644 --- a/Dropbox/OAuth/Consumer/Curl.php +++ b/Dropbox/OAuth/Consumer/Curl.php @@ -74,6 +74,14 @@ public function fetch($method, $url, $call, array $additional = array()) { // Get the signed request URL $request = $this->getSignedRequest($method, $url, $call, $additional); + + if (function_exists('curl_file_create')) { + foreach ($request['postfields'] as $name => &$value) { + if (preg_match('/^@(?.+);filename=(?.+)$/', $value, $matches)) { + $value = curl_file_create($matches['file'], 'application/octet-stream', $matches['filename']); + } + } + } // Initialise and execute a cURL request $handle = curl_init($request['url']);