[VD:OneDrive,Box] fix #1774 dose not work in PHP has open_basedir

This commit is contained in:
nao-pon
2016-11-27 13:24:55 +09:00
parent 68a6355a4d
commit 837d292b72
3 changed files with 51 additions and 36 deletions
+3 -20
View File
@@ -185,8 +185,6 @@ class elFinderVolumeBox extends elFinderVolumeDriver
curl_setopt_array($curl, array(
// General options.
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_AUTOREFERER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $fields,
CURLOPT_URL => $url,
@@ -231,8 +229,6 @@ class elFinderVolumeBox extends elFinderVolumeDriver
curl_setopt_array($curl, array(
// General options.
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_AUTOREFERER => true,
CURLOPT_POST => true, // i am sending post data
CURLOPT_POSTFIELDS => 'client_id='.urlencode($this->options['client_id'])
.'&client_secret='.urlencode($this->options['client_secret'])
@@ -279,8 +275,6 @@ class elFinderVolumeBox extends elFinderVolumeDriver
$defaultOptions = array(
// General options.
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_AUTOREFERER => true,
);
curl_setopt_array($curl, $options + $defaultOptions);
@@ -298,7 +292,6 @@ class elFinderVolumeBox extends elFinderVolumeDriver
protected function _bd_fetch($url, $contents = false)
{
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if ($contents) {
@@ -349,21 +342,11 @@ class elFinderVolumeBox extends elFinderVolumeDriver
*/
protected function _bd_curlExec($curl, $decodeOrParent = true, $headers = array())
{
curl_setopt($curl, CURLOPT_HTTPHEADER, array_merge(array(
$headers = array_merge(array(
'Authorization: Bearer '.$this->token->data->access_token,
), $headers));
), $headers);
$result = curl_exec($curl);
if ($result === false) {
if (curl_errno($curl)) {
throw new \Exception('curl_exec() failed: '.curl_error($curl));
} else {
throw new \Exception('curl_exec(): empty response');
}
}
curl_close($curl);
$result = elFinder::curlExec($curl, array(), $headers);
if (!$decodeOrParent) {
return $result;