mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[VD:OneDrive,Box] fix #1774 dose not work in PHP has open_basedir
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user